/* 一抹青撮合 · 商家 / 主播工作台 H5
 * UI 规范（2026-09-19 青青统一）：
 *   1) 正文 ≥14px，辅助文字 ≥12.5px，输入框 16px（iOS 不放大）
 *   2) 按钮文字一律不换行，触控高度 ≥40px
 *   3) 全元素 border-box + max-width:100%，杜绝横向溢出
 *   4) 长标题最多 2 行截断，标签一律 nowrap，避免「五六个字折成两三行」
 *   5) 弹层最高 86vh，内部滚动，不影响底层页面滚动
 */
:root {
  --teal: #16B8A6;
  --teal-dark: #0D9488;
  --bg: #f5f7fa;
  --card: #ffffff;
  --text: #1a1a2e;
  --muted: #8a8a9a;
  --border: #e6e9f0;
  --danger: #e5484d;
  --warn: #e08b00;
  --radius: 14px;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { max-width: 100%; overflow-x: hidden; }
/* 【2026-09-19 青青】hidden 属性兜底（真机实测 bug）：
   弹层 .sheet-mask{display:flex} 的优先级高于浏览器给 [hidden] 的 display:none，
   结果带 hidden 的 #sheet 在登录页就露在屏幕最底部——一条空白「详情」栏，
   还拖着一层半透明蒙层把整页压暗。这里统一兜底：凡带 hidden 的元素一律不渲染。 */
[hidden] { display: none !important; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6;
  padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
  font-size: 14.5px;
}
img { max-width: 100%; height: auto; }
button { font-family: inherit; }
button, .tab, .btn-sm, .auth-tab { white-space: nowrap; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.brand { font-size: 19px; font-weight: 800; color: var(--teal); letter-spacing: .5px; flex-shrink: 0; }
.brand span { color: var(--text); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.role-tag {
  font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: #e6f7f4; color: var(--teal-dark); font-weight: 600;
  white-space: nowrap; flex-shrink: 0;
}
.link-btn {
  background: none; border: none; color: var(--muted); font-size: 14px;
  cursor: pointer; padding: 6px 4px; flex-shrink: 0;
}
.link-btn:active { color: var(--teal-dark); }

/* ---------- 视图容器 ---------- */
.view { max-width: 760px; margin: 0 auto; padding: 16px 14px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card); border-radius: var(--radius); padding: 18px 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
.login-card { max-width: 400px; margin: 6vh auto 0; }
.login-card h2 { font-size: 21px; margin-bottom: 4px; line-height: 1.4; }
.subtitle { color: var(--muted); font-size: 13px; margin-bottom: 18px; line-height: 1.6; }

label { display: block; font-size: 14px; color: #3d3d4e; margin-bottom: 13px; }
input[type=text], input[type=tel], input[type=password], input[type=datetime-local],
input[type=number], select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 11px 12px;
  border: 1px solid var(--border); border-radius: 10px; font-size: 16px;
  background: #fff; color: var(--text); line-height: 1.4;
}
textarea { resize: vertical; min-height: 74px; font-size: 15px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #9aa 50%), linear-gradient(135deg, #9aa 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); }

.primary-btn {
  width: 100%; padding: 13px 16px; margin-top: 4px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark)); color: #fff;
  font-size: 16px; font-weight: 600; cursor: pointer; min-height: 46px;
}
.primary-btn:active { transform: scale(0.99); }
.primary-btn:disabled { opacity: .55; cursor: not-allowed; }
.msg { min-height: 18px; font-size: 13px; color: var(--danger); margin-top: 9px; text-align: center; line-height: 1.6; }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tab {
  flex: 1 1 0; min-width: 108px; text-align: center; padding: 11px 8px;
  border-radius: 12px; background: #fff; border: 1px solid var(--border);
  font-size: 14px; cursor: pointer; color: var(--muted); font-weight: 600;
}
.tab.active { background: var(--teal); color: #fff; border-color: var(--teal); }

.tab-content > .card { margin-bottom: 14px; }
.section-title { font-size: 16.5px; font-weight: 700; margin-bottom: 14px; line-height: 1.5; }
.sub-note { font-size: 12.5px; color: var(--muted); line-height: 1.7; margin-top: 10px; }

.row2 { display: flex; gap: 10px; }
.row2 > label { flex: 1 1 0; min-width: 0; }
@media (max-width: 430px) {
  .row2 { flex-wrap: wrap; gap: 0; }
  .row2 > label { flex: 1 1 100%; }
}

.checks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.checks label {
  display: inline-flex; align-items: center; gap: 5px; margin: 0; font-size: 13px;
  padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px;
  cursor: pointer; color: #3d3d4e; white-space: nowrap;
}
.checks input { width: auto; margin: 0; accent-color: var(--teal); }
.checks label.on { background: #e6f7f4; border-color: var(--teal); color: var(--teal-dark); }

/* ---------- 列表项 ---------- */
.task-item {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 14px;
  margin-bottom: 12px; background: #fff; cursor: pointer;
}
.task-item:last-child { margin-bottom: 0; }
.task-item h4 {
  font-size: 15.5px; line-height: 1.5; margin-bottom: 7px; font-weight: 700;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  word-break: break-word;
}
.task-meta {
  font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap;
  gap: 6px 12px; margin: 5px 0; line-height: 1.6;
}
.task-meta > span { white-space: nowrap; }
.tag {
  font-size: 12px; padding: 2px 8px; border-radius: 6px; background: #eef2ff;
  color: #5b6ee1; white-space: nowrap; line-height: 1.7;
}
.tag.green { background: #e8f7ee; color: #1f9455; }
.tag.orange { background: #fff4e5; color: #c47a00; }
.tag.red { background: #fdebed; color: #d1363c; }
.tag.gray { background: #f0f1f5; color: #77778a; }
.price { color: var(--teal-dark); font-weight: 700; }
.task-actions { margin-top: 11px; display: flex; flex-wrap: wrap; gap: 8px; }
.btn-sm {
  padding: 9px 16px; border-radius: 10px; border: none; font-size: 14px;
  cursor: pointer; font-weight: 600; background: var(--teal); color: #fff; min-height: 40px;
}
.btn-sm.ghost { background: #fff; color: var(--teal-dark); border: 1px solid var(--teal); }
.btn-sm.gray { background: #fff; color: var(--muted); border: 1px solid var(--border); }
.btn-sm:disabled { background: #cdd3db; color: #fff; cursor: not-allowed; border-color: #cdd3db; }

.empty { text-align: center; color: var(--muted); padding: 34px 12px; font-size: 14px; line-height: 1.7; }

/* ---------- 提示条 ---------- */
.banner {
  border-radius: 12px; padding: 12px 14px; font-size: 13.5px; line-height: 1.7;
  margin-bottom: 14px; word-break: break-word;
}
.banner.warn { background: #fff8ec; border: 1px solid #ffd9a8; color: #8a5a00; }
.banner.info { background: #eef7f5; border: 1px solid #b9e5dd; color: #176b5d; }
.banner.danger { background: #fdebed; border: 1px solid #f7c6ca; color: #a8272d; }

/* ---------- 详情弹层 ---------- */
.sheet-mask {
  position: fixed; inset: 0; background: rgba(20,22,34,0.45);
  display: flex; align-items: flex-end; justify-content: center; z-index: 60;
}
@media (min-width: 620px) { .sheet-mask { align-items: center; } }
.sheet {
  background: #fff; width: 100%; max-width: 640px; border-radius: 18px 18px 0 0;
  max-height: 86vh; display: flex; flex-direction: column; overflow: hidden;
  animation: sheetUp .18s ease-out;
}
@media (min-width: 620px) { .sheet { border-radius: 18px; } }
@keyframes sheetUp { from { transform: translateY(24px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.sheet-title {
  font-size: 16.5px; font-weight: 700; min-width: 0; line-height: 1.5;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sheet-close {
  background: #f2f4f8; border: none; width: 30px; height: 30px; border-radius: 50%;
  font-size: 14px; color: #666; cursor: pointer; flex-shrink: 0; line-height: 1;
}
.sheet-body { padding: 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.kv { display: flex; gap: 12px; font-size: 13.5px; padding: 7px 0; border-bottom: 1px dashed #eef0f5; }
.kv:last-child { border-bottom: none; }
.kv b { color: var(--muted); font-weight: 500; flex-shrink: 0; min-width: 74px; }
.kv span { flex: 1 1 auto; min-width: 0; word-break: break-word; }

.acct-box {
  background: #f7fbfa; border: 1px solid #b9e5dd; border-radius: 12px;
  padding: 13px 14px; margin: 12px 0; font-size: 14px;
}
.acct-box .acct-row { display: flex; gap: 10px; padding: 5px 0; align-items: flex-start; }
.acct-box .acct-row b { color: #176b5d; font-weight: 600; flex-shrink: 0; min-width: 74px; }
.acct-box .acct-row span { flex: 1 1 auto; min-width: 0; word-break: break-all; font-weight: 600; }
.copy-btn {
  background: #fff; border: 1px solid var(--teal); color: var(--teal-dark);
  border-radius: 8px; font-size: 12.5px; padding: 3px 9px; cursor: pointer;
  flex-shrink: 0; white-space: nowrap;
}

.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: rgba(26,26,46,0.93); color: #fff; padding: 11px 18px; border-radius: 10px;
  font-size: 14px; z-index: 90; max-width: 86%; text-align: center; line-height: 1.6;
}
.hidden { display: none !important; }

/* ---------- 登录 / 注册双页签 ---------- */
.auth-tabs { display: flex; gap: 6px; background: #f2f5f9; border-radius: 12px; padding: 4px; margin: 14px 0 16px; }
.auth-tab {
  flex: 1; text-align: center; padding: 10px; border-radius: 9px; font-size: 14.5px;
  font-weight: 600; color: var(--muted); cursor: pointer; transition: all .15s;
}
.auth-tab.active { background: #fff; color: var(--teal-dark); box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.auth-hint { font-size: 13px; color: var(--muted); text-align: center; margin-top: 14px; }
.auth-hint a { color: var(--teal-dark); font-weight: 600; text-decoration: none; }
.auth-note {
  margin-top: 16px; padding: 12px; border-radius: 10px; background: #f0fbf9;
  font-size: 12.5px; color: #4a7d74; line-height: 1.8; border: 1px dashed #9fe0d4;
}
.auth-note strong { color: var(--teal-dark); }
