/* 青山FDE · 移动端 H5 共享样式 */
:root {
  --green: #0e7a4a;
  --green-deep: #0a5c38;
  --green-light: #e6f4ec;
  --teal: #0d9488;
  --ink: #1a2b22;
  --ink-2: #55685e;
  --ink-3: #8fa39a;
  --line: #e3ece7;
  --bg: #f4f8f5;
  --card: #ffffff;
  --amber: #d97706;
  --red: #dc2626;
  --blue: #2563eb;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(14, 122, 74, .08);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.6;
}
.page { max-width: 480px; margin: 0 auto; min-height: 100vh; padding-bottom: 84px; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(135deg, var(--green-deep), var(--green) 60%, var(--teal));
  color: #fff; padding: 14px 18px 16px;
}
.topbar .brand { font-size: .78rem; opacity: .85; letter-spacing: .12em; cursor: pointer; }
.topbar .brand:hover { opacity: 1; }
.topbar h1 { font-size: 1.15rem; font-weight: 700; margin-top: 2px; }
.topbar .sub { font-size: .8rem; opacity: .9; margin-top: 2px; }

/* 卡片 */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin: 12px 14px;
}
.card h3 { font-size: 1rem; margin-bottom: 10px; }
.card .hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }

/* 输入 */
textarea, input[type=text], input[type=tel], input[type=number], input[type=password], select {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 12px; font-size: 1rem; font-family: inherit; background: #fff; color: var(--ink);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea:focus, input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(14, 122, 74, .1); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
textarea { resize: none; }
label.fld { display: block; font-size: .85rem; color: var(--ink-2); margin: 12px 0 6px; font-weight: 600; }

/* 按钮 */
.btn {
  display: block; width: 100%; border: none; border-radius: 12px;
  padding: 14px; font-size: 1.05rem; font-weight: 700; font-family: inherit;
  background: linear-gradient(135deg, var(--green), var(--teal)); color: #fff;
  cursor: pointer; transition: opacity .15s;
}
.btn:active { opacity: .85; }
.btn.ghost { background: #fff; color: var(--green); border: 1.5px solid var(--green); }
.btn.warn { background: #fff; color: var(--red); border: 1.5px solid #f3c1c1; }
.btn.sm { padding: 9px 14px; font-size: .9rem; width: auto; display: inline-block; border-radius: 9px; }
.btn[disabled] { opacity: .45; }

/* 场景模板 chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 14px; border-radius: 999px; font-size: .88rem;
  background: var(--green-light); color: var(--green-deep); border: 1px solid transparent; cursor: pointer;
}
.chip.on { background: var(--green); color: #fff; }

/* 标签 */
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.tag.green { background: var(--green-light); color: var(--green-deep); }
.tag.amber { background: #fef3e2; color: var(--amber); }
.tag.blue  { background: #e8effd; color: var(--blue); }
.tag.gray  { background: #eef1ef; color: var(--ink-2); }
.tag.red   { background: #fdeaea; color: var(--red); }

/* 进度五节点 */
.steps { display: flex; margin: 14px 0 4px; }
.step { flex: 1; text-align: center; position: relative; }
.step .dot {
  width: 22px; height: 22px; border-radius: 50%; margin: 0 auto 6px;
  background: #dfe8e2; color: #fff; font-size: .7rem; line-height: 22px; position: relative; z-index: 2;
}
.step::before {
  content: ""; position: absolute; top: 11px; left: -50%; width: 100%; height: 3px; background: #dfe8e2; z-index: 1;
}
.step:first-child::before { display: none; }
.step.done .dot, .step.now .dot { background: var(--green); }
.step.done::before, .step.now::before { background: var(--green); }
.step.now .dot { box-shadow: 0 0 0 5px rgba(14,122,74,.18); }
.step .lb { font-size: .72rem; color: var(--ink-3); }
.step.done .lb, .step.now .lb { color: var(--green-deep); font-weight: 600; }

/* 时间线 */
.tl { margin-top: 8px; }
.tl-item { display: flex; gap: 10px; padding: 8px 0; }
.tl-item .d { width: 10px; height: 10px; border-radius: 50%; background: var(--green); margin-top: 7px; flex: none; }
.tl-item.gray .d { background: #cfdad3; }
.tl-item .t { font-size: .75rem; color: var(--ink-3); }
.tl-item .n { font-size: .88rem; color: var(--ink-2); }
.tl-item b { font-size: .9rem; }

/* 列表行 */
.row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.row:last-child { border-bottom: none; }
.row .k { color: var(--ink-2); }
.muted { color: var(--ink-3); font-size: .82rem; }
.big { font-size: 1.5rem; font-weight: 800; color: var(--green-deep); }

/* 底部导航 */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; background: #fff; border-top: 1px solid var(--line);
  display: flex; z-index: 30; padding-bottom: env(safe-area-inset-bottom);
}
.tab { flex: 1; text-align: center; padding: 9px 0 7px; color: var(--ink-3); font-size: .72rem; cursor: pointer; }
.tab .ic { font-size: 1.3rem; display: block; line-height: 1.25; }
.tab.on { color: var(--green); font-weight: 700; }

/* 视图切换 */
.view { display: none; }
.view.on { display: block; }

/* 弹层 */
.sheet-mask { position: fixed; inset: 0; background: rgba(10,25,18,.45); z-index: 40; display: none; }
.sheet-mask.on { display: block; }
.sheet {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%) translateY(105%);
  width: 100%; max-width: 480px; background: #fff; border-radius: 18px 18px 0 0;
  z-index: 41; padding: 18px 18px calc(20px + env(safe-area-inset-bottom));
  transition: transform .25s ease; max-height: 82vh; overflow-y: auto;
}
.sheet.on { transform: translateX(-50%) translateY(0); }
.sheet h3 { margin-bottom: 12px; }

/* toast */
#toast {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%);
  background: rgba(20,35,28,.92); color: #fff; padding: 10px 24px; border-radius: 20px;
  font-size: .85rem; z-index: 99; display: none; max-width: 80%;
  animation: toastIn .3s ease-out;
}

/* 星级 */
.stars { display: flex; gap: 6px; font-size: 1.7rem; color: #d9e2dc; cursor: pointer; }
.stars .s.on { color: #f5a623; }

/* 空态 */
.empty { text-align: center; color: var(--ink-3); padding: 42px 0; font-size: .9rem; }
.empty .ic { font-size: 2.4rem; display: block; margin-bottom: 8px; }

/* ===== 协作者贡献：统一账号模块 + 主页登录浮层 ===== */
.topbar { position: relative; }
.acc-bar { display: flex; justify-content: flex-end; }
.acc-bar.top { flex: none; margin-left: auto; }
.acc { position: relative; }
.acc-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.18); color: #fff;
  border: 1px solid rgba(255,255,255,.4); border-radius: 999px;
  padding: 6px 12px; font-size: .82rem; font-family: inherit; cursor: pointer;
  white-space: nowrap; line-height: 1.2;
}
.acc-btn:active { background: rgba(255,255,255,.28); }
.acc-caret { font-size: .7rem; opacity: .85; }
.acc-badge {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  font-size: .68rem; font-weight: 600; margin-left: 3px;
}
.acc-badge.acc-client { background: #2563eb; }
.acc-badge.acc-fde    { background: #0e7a4a; }
.acc-badge.acc-sales  { background: #d97706; }
.acc-badge.acc-admin  { background: #7c3aed; }
.acc-login {
  display: inline-block; background: rgba(255,255,255,.2); color: #fff;
  border: 1px solid rgba(255,255,255,.4); border-radius: 999px;
  padding: 6px 16px; font-size: .85rem; text-decoration: none; cursor: pointer;
}
.acc-login:active { background: rgba(255,255,255,.28); }
.acc-menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 180px;
  background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18);
  padding: 6px 0; display: none; z-index: 50;
}
.acc-menu.open { display: block; }
.acc-menu .acc-head { padding: 10px 16px; font-weight: 700; font-size: .92rem; color: var(--ink); border-bottom: 1px solid var(--line); }
.acc-menu .acc-head small { display: block; font-weight: 400; font-size: .72rem; color: var(--ink-3); margin-top: 2px; }
.acc-menu a, .acc-menu button {
  display: block; width: 100%; text-align: left; padding: 10px 16px;
  font-size: .88rem; color: var(--ink-2); text-decoration: none;
  border: none; background: none; cursor: pointer; font-family: inherit;
}
.acc-menu a:hover, .acc-menu button:hover { background: var(--bg); }
.acc-divider { height: 1px; background: var(--line); margin: 4px 0; }

/* 主页登录浮层 */
.acc-login-mask { position: fixed; inset: 0; background: rgba(8,40,28,.55); display: none; align-items: center; justify-content: center; z-index: 60; padding: 18px; }
.acc-login-mask.open { display: flex; }
.acc-login-box { position: relative; width: 100%; max-width: 340px; background: #fff; border-radius: 18px; padding: 22px 20px 18px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.acc-login-x { position: absolute; right: 12px; top: 8px; border: 0; background: transparent; font-size: 1.6rem; line-height: 1; color: var(--ink-3); cursor: pointer; }
.acc-login-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.acc-login-tab { flex: 1; border: 1px solid var(--line, #e3e8e6); background: #f6f8f7; border-radius: 10px; padding: 8px 2px; font-size: .8rem; color: var(--ink-2); cursor: pointer; transition: .15s; white-space: nowrap; }
.acc-login-tab.on { background: var(--green); color: #fff; border-color: var(--green); font-weight: 700; }
.acc-login-acc, .acc-login-pwd { width: 100%; box-sizing: border-box; border: 1px solid var(--line, #e3e8e6); border-radius: 10px; padding: 11px 12px; font-size: .95rem; margin-bottom: 10px; outline: none; }
.acc-login-acc:focus, .acc-login-pwd:focus { border-color: var(--green); }
.acc-login-sub { width: 100%; border: 0; border-radius: 10px; padding: 12px; background: var(--green); color: #fff; font-size: 1rem; font-weight: 700; cursor: pointer; }
.acc-login-sub:active { transform: translateY(1px); }
.acc-login-err { color: #d23; font-size: .82rem; min-height: 1em; margin-top: 8px; text-align: center; }
.acc-login-demo { color: var(--ink-3); font-size: .76rem; text-align: center; margin-top: 6px; }
.acc-login-mode { display: flex; gap: 6px; margin-bottom: 12px; }
.acc-mode { flex: 1; border: 1px solid var(--line, #e3e8e6); background: #f6f8f7; border-radius: 10px; padding: 7px 2px; font-size: .82rem; color: var(--ink-2); cursor: pointer; transition: .15s; }
.acc-mode.on { background: var(--green-deep, #0b6b4f); color: #fff; border-color: var(--green-deep, #0b6b4f); font-weight: 700; }
.acc-login-tab.disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }
.acc-login-form .reg-phone, .acc-login-form .reg-pwd, .acc-login-form .reg-name, .acc-login-form .reg-company, .acc-login-form .reg-level, .acc-login-form .reg-type { width: 100%; box-sizing: border-box; border: 1px solid var(--line, #e3e8e6); border-radius: 10px; padding: 11px 12px; font-size: .95rem; margin-bottom: 10px; outline: none; background: #fff; }
.acc-login-form .reg-phone:focus, .acc-login-form .reg-pwd:focus, .acc-login-form .reg-name:focus, .acc-login-form .reg-company:focus, .acc-login-form .reg-level:focus, .acc-login-form .reg-type:focus { border-color: var(--green); }

/* ===== 全局加载指示器 ===== */
#loader {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  height: 3px;
  background: linear-gradient(90deg, var(--green), var(--teal), var(--green));
  background-size: 200% 100%;
  animation: loaderSlide 1.2s ease-in-out infinite;
  display: none;
  pointer-events: none;
}
#loader.on { display: block; }
@keyframes loaderSlide {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ===== 页面切换过渡 ===== */
.view {
  display: none;
}
.view.on {
  display: block;
  animation: viewIn .25s ease-out;
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Toast 弹入动画 ===== */
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== 卡片点击态 ===== */
.card.clickable:active, tr.click:active {
  transform: scale(.98);
  transition: transform .1s;
}

/* ===== 自定义弹窗（替换原生 confirm/alert/prompt） ===== */
.fde-modal-root {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.fde-modal-mask {
  position: absolute; inset: 0;
  background: rgba(10, 25, 18, .5);
  animation: fdeFade .2s ease-out;
}
.fde-modal-card {
  position: relative; width: 100%; max-width: 340px;
  background: var(--card); border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
  padding: 22px 20px 18px; text-align: center;
  animation: fdePop .22s cubic-bezier(.16,1,.3,1);
}
.fde-modal-icon { font-size: 2rem; line-height: 1; margin-bottom: 8px; }
.fde-modal-title { font-size: 1.05rem; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.fde-modal-msg { font-size: .92rem; color: var(--ink-2); line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.fde-modal-field { margin-top: 14px; text-align: left; }
.fde-modal-input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 11px 12px; font-size: .95rem; font-family: inherit; background: #fff; color: var(--ink);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.fde-modal-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(14,122,74,.1); }
.fde-modal-err { margin-top: 8px; color: var(--red); font-size: .82rem; text-align: left; }
.fde-modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.fde-modal-btn {
  flex: 1; border: none; border-radius: 11px; padding: 12px;
  font-size: 1rem; font-weight: 700; font-family: inherit; cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.fde-modal-btn:active { transform: scale(.98); }
.fde-modal-btn.primary { background: linear-gradient(135deg, var(--green), var(--teal)); color: #fff; }
.fde-modal-btn.danger { background: var(--red); color: #fff; }
.fde-modal-btn.ghost { background: #fff; color: var(--green); border: 1.5px solid var(--green); }
.fde-modal-btn[disabled] { opacity: .45; }
@keyframes fdeFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fdePop { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
