/* 企服云 EMS · 员工端 H5 样式（依赖 tokens.css） */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
.muted { color: var(--muted); }
.strong { font-weight: 600; color: var(--text); }
.h5-app { max-width: 480px; margin: 0 auto; min-height: 100vh; padding-bottom: 74px; position: relative; background: var(--bg); }
.h5-body { padding: 0 14px 16px; }
.h5-hero {
  background:
    radial-gradient(360px 220px at 100% 0%, rgba(176, 138, 79, .26) 0%, transparent 62%),
    linear-gradient(155deg, #0B1220 0%, #1D2939 68%, #2A3B4F 100%);
  color: var(--on-dark); padding: 26px 18px 48px; border-radius: 0 0 var(--radius-xl) var(--radius-xl); position: relative; overflow: hidden;
}
.h5-hero::after { content: ""; position: absolute; right: -40px; top: -50px; width: 160px; height: 160px; border-radius: 50%; border: 1px solid rgba(176, 138, 79, .22); }
.h5-hero h1 { margin: 0; font-size: 21px; letter-spacing: .5px; font-weight: 600; }
.h5-hero .sub { margin-top: 6px; font-size: 12px; color: rgba(249, 250, 251, .72); }
.h5-hero .role-chip { display: inline-block; margin-top: 10px; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .16); font-size: 11px; color: var(--on-dark); }
.hero-clock { margin-top: 16px; font-size: 30px; font-weight: 700; letter-spacing: 1px; font-variant-numeric: tabular-nums; color: #fff; }
.hero-tip { font-size: 12px; color: rgba(249, 250, 251, .72); margin-top: 4px; }
.hero-actions { position: absolute; right: 18px; top: 20px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; z-index: 1; }
.hero-btn { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); color: #fff; border-radius: 999px; padding: 7px 14px; font-size: 12.5px; backdrop-filter: blur(6px); }
.h5-section { margin-top: 16px; }
.h5-section-title { display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 600; color: var(--text); margin: 0 2px 10px; letter-spacing: .1px; }
.h5-section-title a { font-size: 12px; color: var(--accent-ink); font-weight: 400; }
.m-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px;
  box-shadow: var(--shadow-xs); margin-bottom: 12px;
}
.m-card-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 4px 11px; text-align: center; box-shadow: var(--shadow-xs); }
.quick-icon { width: 38px; height: 38px; border-radius: var(--radius-sm); margin: 0 auto 7px; display: flex; align-items: center; justify-content: center; color: #fff; }
.quick-icon svg { width: 19px; height: 19px; }
.quick-label { font-size: 11.5px; color: var(--text-sub); }
.hero-card {
  margin: -30px 14px 0; position: relative; z-index: 2;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.hero-card .big { font-size: 29px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.hero-card .desc { font-size: 12px; color: var(--muted); margin-top: 5px; }
.hero-card .btn { flex: 0 0 auto; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px;
  padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--card);
  color: var(--text-sub); font-size: 13px; font-weight: 500; cursor: pointer;
}
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: var(--shadow-xs); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #241A09; font-weight: 600; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: var(--radius-sm); }
.btn-danger { color: var(--red); border-color: var(--red-line); }
.btn-block { display: flex; width: 100%; }
.btn:disabled { opacity: .45; }
.m-list { display: flex; flex-direction: column; }
.m-item { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line-soft); }
.m-item:last-child { border-bottom: none; }
.m-icon { width: 38px; height: 38px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; flex: 0 0 38px; }
.m-item .m-main { flex: 1; min-width: 0; }
.m-item .m-title { font-size: 13.5px; color: var(--text); }
.m-item .m-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.m-item .m-right { color: var(--muted-light); font-size: 12px; }
.m-input, select.m-input, textarea.m-input {
  width: 100%; height: 42px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--card);
  padding: 0 12px; font-size: 14px; color: var(--text); outline: none; font-family: inherit;
}
select.m-input { padding-right: 8px; }
textarea.m-input { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.6; }
.m-input:focus { border-color: var(--accent); box-shadow: var(--focus-ring); }
.m-field { margin-bottom: 14px; }
.m-field > label { display: block; font-size: 12.5px; color: var(--text-sub); margin-bottom: 7px; font-weight: 500; }
.m-label-dark > label { color: var(--text-sub); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--ink-100); color: var(--text-sub); font-size: 11px; }
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 11px; white-space: nowrap; font-weight: 500; border: 1px solid transparent; }
.badge-green { background: var(--green-soft); color: var(--green); border-color: var(--green-line); }
.badge-orange { background: var(--orange-soft); color: var(--orange); border-color: var(--orange-line); }
.badge-red { background: var(--red-soft); color: var(--red); border-color: var(--red-line); }
.badge-blue { background: var(--blue-soft); color: var(--blue); border-color: var(--blue-line); }
.badge-gray { background: var(--ink-100); color: var(--muted); border-color: var(--line); }
.badge-purple { background: var(--purple-soft); color: var(--purple); border-color: var(--purple-line); }
.badge-gold { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-line); }
.m-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.m-stat { background: var(--card-sub); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 10px; text-align: center; }
.m-stat .k { font-size: 11px; color: var(--muted); }
.m-stat .v { font-size: 17px; font-weight: 700; color: var(--text); margin-top: 4px; font-variant-numeric: tabular-nums; }
.amount { color: var(--accent-ink); font-weight: 700; }
.amount-big { font-size: 27px; font-weight: 700; color: var(--accent-ink); font-variant-numeric: tabular-nums; letter-spacing: -.4px; }
.m-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; }
.m-tabs a { white-space: nowrap; padding: 7px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line-strong); font-size: 12.5px; color: var(--text-sub); }
.m-tabs a.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 500; }
.m-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 34px 0; }
.m-form-actions { display: flex; gap: 10px; margin-top: 6px; }
.m-form-actions .btn { flex: 1; }
.tabbar {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 480px;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  display: flex; padding: 7px 6px calc(7px + env(safe-area-inset-bottom)); z-index: 100;
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; color: var(--muted-light); padding: 3px 0; }
.tabbar a svg { width: 21px; height: 21px; }
.tabbar a.active { color: var(--primary); font-weight: 600; }
.tabbar a.active .tab-dot { display: block; }
.tab-dot { display: none; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.h5-topbar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.h5-topbar .back { width: 30px; height: 30px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); display: flex; align-items: center; justify-content: center; color: var(--text-sub); }
.h5-topbar h2 { font-size: 16px; margin: 0; flex: 1; text-align: center; color: var(--text); font-weight: 600; }
.h5-topbar .right { width: 30px; }
.alert { border-radius: var(--radius-sm); padding: 11px 13px; font-size: 13px; margin-bottom: 12px; border: 1px solid transparent; }
.alert-error { background: var(--red-soft); color: var(--red); border-color: var(--red-line); }
.alert-success { background: var(--green-soft); color: var(--green); border-color: var(--green-line); }
.alert-info { background: var(--blue-soft); color: var(--blue); border-color: var(--blue-line); }
.toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 999; background: rgba(16, 24, 40, .94); color: #fff; padding: 9px 18px; border-radius: var(--radius-sm); font-size: 12.5px; box-shadow: var(--shadow-lg); }
.toast.error { background: rgba(180, 35, 24, .96); }
.money-list .m-item { padding: 13px 2px; }
.money-list .val { font-weight: 700; color: var(--text); }
.m-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.detail-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.detail-row:last-child { border-bottom: none; }
.detail-row .k { color: var(--muted); }
.detail-row .v { color: var(--text); text-align: right; }
.m-detail-img { width: 72px; height: 56px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); margin: 4px 6px 0 0; }
.notice-content { line-height: 1.85; color: var(--text-sub); white-space: pre-wrap; font-size: 13.5px; }
.chat-h5 { padding-bottom: 74px; }
.chat-msgs { height: calc(100vh - 170px); overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--bg-soft); }
.msg { display: flex; gap: 8px; max-width: 82%; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--ink-100); color: var(--text-sub); display: flex; align-items: center; justify-content: center; font-size: 11px; flex: 0 0 30px; }
.msg.mine .msg-avatar { background: var(--primary); color: #fff; }
.msg-bubble { background: var(--card); border: 1px solid var(--line); padding: 9px 12px; border-radius: var(--radius); font-size: 13px; line-height: 1.6; word-break: break-word; color: var(--text); }
.msg.mine .msg-bubble { background: var(--primary); border-color: var(--primary); color: #fff; }
.chat-input { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 480px; background: var(--card); border-top: 1px solid var(--line); padding: 9px 12px calc(9px + env(safe-area-inset-bottom)); display: flex; gap: 8px; z-index: 100; }
.chat-input textarea { flex: 1; height: 40px; min-height: 40px; resize: none; border-radius: var(--radius-sm); }
.m-check { display: flex; align-items: center; gap: 8px; padding: 8px 0; font-size: 13px; }
.timeline { padding-left: 18px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 14px 8px; }
.tl-item::before { content: ""; position: absolute; left: -17px; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tl-time { font-size: 11px; color: var(--muted); }
.tl-title { font-size: 13px; margin: 2px 0; color: var(--text); }
.tl-desc { font-size: 12px; color: var(--text-sub); }

/* H5 登录页 */
.login-page { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px 20px; background: var(--bg); }
.login-hero { border-radius: var(--radius-xl); padding: 28px 22px; color: var(--on-dark); background: linear-gradient(155deg, #0B1220 0%, #1D2939 68%, #2A3B4F 100%); margin-bottom: 18px; }
.login-hero h1 { margin: 0; font-size: 22px; letter-spacing: .5px; }
.login-hero p { margin: 10px 0 0; font-size: 12.5px; line-height: 1.85; color: rgba(249, 250, 251, .74); }

/* ---------------- 页面整理通用类（呈现层） ---------------- */
/* 覆盖在 hero 上的数据卡：统一使用 .pull */
.hero-card.pull { margin-top: -38px; }
/* 作为链接使用的整块卡片 */
.m-card.is-link { display: block; }
/* 两行截断 */
.m-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* 头像 */
.m-avatar-lg {
  width: 58px; height: 58px; border-radius: 50%; flex: 0 0 58px;
  background: rgba(255, 255, 255, .28); display: flex; align-items: center; justify-content: center;
  font-size: 23px; font-weight: 700;
}
/* 顶部提示条容器 */
.m-alert-wrap { padding: 12px 14px 0; }
/* 快捷入口配色（替代行内渐变） */
.quick-icon.qk-blue { background: linear-gradient(135deg, #1677ff, #5aa8ff); }
.quick-icon.qk-cyan { background: linear-gradient(135deg, #00b8d9, #5ad8e8); }
.quick-icon.qk-gold { background: linear-gradient(135deg, #ffb020, #ffd166); }
.quick-icon.qk-green { background: linear-gradient(135deg, #12a67a, #5ad3ae); }
.quick-icon.qk-purple { background: linear-gradient(135deg, #8b6cf0, #b39cf7); }
.quick-icon.qk-red { background: linear-gradient(135deg, #f04438, #ff8a80); }
.quick-icon.qk-sky { background: linear-gradient(135deg, #3d95ff, #7cc3ff); }
.quick-icon.qk-violet { background: linear-gradient(135deg, #7147d8, #a78bfa); }
/* 列表项状态 */
.m-icon.is-unread { background: var(--orange-soft); color: var(--orange); }
.m-title.is-unread { font-weight: 600; }
/* 日期/工时格子 */
.day-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.day-cell {
  border: 1px solid var(--line); border-radius: 8px; padding: 6px; text-align: center;
  font-size: 12px; color: var(--text-sub);
}
.day-cell.is-filled { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.day-input { padding: 7px 6px; text-align: center; }
.day-grid.is-tight { gap: 6px; }
/* 聊天区高度（H5 AI 页） */
.chat-box-h5 { height: calc(100vh - 330px); border: 1px solid var(--line); border-radius: 14px; margin-top: 12px; }
.chat-page-pad { padding: 14px 14px 120px; }
/* 底部说明 */
.h5-footnote { text-align: center; font-size: 11.5px; color: var(--muted-light); line-height: 1.8; padding: 0 6px 20px; }
/* 错误页 */
.h5-error { padding-top: 60px; text-align: center; }
.h5-error .icon { font-size: 44px; line-height: 1; }
/* 表单细节 */
.m-input.grow { flex: 1 1 auto; min-width: 0; }
.m-field.is-flat { margin-bottom: 0; }
.m-form-actions.row-actions { justify-content: flex-end; gap: 8px; margin: 2px 0 10px; }
.m-form-actions.row-actions .btn { flex: 0 0 auto; }

/* 上传控件即时预览 */
.upload-preview { margin-top: 8px; }
.upload-preview[hidden] { display: none; }
.upload-thumb {
  display: inline-block; line-height: 0; padding: 3px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.upload-thumb img { width: 88px; height: 88px; object-fit: cover; border-radius: 6px; display: block; }
.upload-file {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 8px 11px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card-sub);
  font-size: 13px; color: var(--text-sub);
}
.upload-file-icon {
  flex: 0 0 auto; min-width: 32px; padding: 2px 5px; border-radius: 4px; text-align: center;
  background: var(--primary-soft); color: var(--primary); font-size: 10.5px; font-weight: 600;
}
.upload-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-file-meta { flex: 0 0 auto; color: var(--muted-light); font-size: 12px; }

/* 登录页布局 */
.h5-hero.hero-login { border-radius: 0 0 30px 30px; padding-bottom: 64px; }
.login-wrap { margin: -46px 16px 0; position: relative; z-index: 2; }
.login-title { margin: 0 0 4px; }
/* 汇报摘要两行截断 */
.m-summary { margin-top: 6px; font-size: 12px; color: var(--text-sub); }
/* 页脚说明（左对齐） */
.h5-note { padding: 0 6px 20px; font-size: 11.5px; color: var(--muted-light); line-height: 1.8; }
