:root {
  --primary: #1F4E79;
  --primary-light: #2E75B6;
  --primary-bg: #D6E4F0;
  --accent: #ED7D31;
  --success: #548235;
  --warning: #FFC000;
  --danger: #C00000;
  --bg: #F5F7FA;
  --card: #FFFFFF;
  --text: #1A1A1A;
  --text-2: #595959;
  --text-3: #8C8C8C;
  --border: #E8E8E8;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --radius: 12px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* 手机容器：375 基准，最大 480 居中 */
.phone {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: 56px; /* 给底部 tab 留位 */
}

/* 顶部导航 */
.topnav {
  height: 44px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topnav .nav-title {
  flex: 1;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}
.topnav .nav-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-2);
}
.topnav .nav-btn svg { width: 22px; height: 22px; }

/* 主内容区 */
.content { padding: 12px; }

/* 卡片 */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}

/* 按钮 */
.btn {
  display: block;
  width: 100%;
  height: 44px;
  line-height: 44px;
  text-align: center;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  transition: background .15s;
}
.btn:active { background: var(--primary-light); }
.btn.secondary {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn.secondary:active { background: #F0F5FA; }
.btn:disabled { background: #BFBFBF; cursor: not-allowed; }
.btn-block-gap { margin-top: 16px; }

/* 表单 */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 6px;
}
.field .input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #D9D9D9;
  border-radius: 6px;
  height: 44px;
  padding: 0 12px;
}
.field .input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 78, 121, 0.12);
}
.field .input-wrap svg { width: 20px; height: 20px; color: var(--text-3); flex: none; }
.field .input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  padding: 0 8px;
  background: transparent;
  color: var(--text);
}
.field .input-wrap .eye {
  width: 22px; height: 22px; cursor: pointer; color: var(--text-3);
}
.field .err { color: var(--danger); font-size: 12px; margin-top: 4px; min-height: 16px; }

/* 登录页 */
.login-wrap { padding: 40px 24px 24px; }
.login-logo {
  width: 64px; height: 64px; border-radius: 16px;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.login-logo svg { width: 34px; height: 34px; }
.login-title { text-align: center; font-size: 22px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.login-sub { text-align: center; color: var(--text-3); font-size: 13px; margin-bottom: 28px; }
.login-footer { text-align: center; color: var(--text-3); font-size: 12px; margin-top: 24px; }
.login-footer a { color: var(--primary-light); text-decoration: none; }

/* 当月工资卡 */
.salary-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius);
  color: #fff;
  padding: 20px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.salary-hero .sh-month { font-size: 14px; opacity: .9; }
.salary-hero .sh-label { font-size: 13px; opacity: .85; margin-top: 12px; }
.salary-hero .sh-amount {
  font-size: 32px; font-weight: 700; color: var(--accent);
  margin: 2px 0 8px; letter-spacing: .5px;
}
.salary-hero .sh-link {
  display: inline-flex; align-items: center; font-size: 13px; opacity: .95; cursor: pointer;
}
.salary-hero .sh-link svg { width: 16px; height: 16px; margin-left: 2px; }

/* 按月查询历史工资 */
.query-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 12px; }
.query-card .qc-label { font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.query-card .qc-row { display: flex; gap: 10px; }
.query-card .q-month {
  flex: 1; height: 40px; border: 1px solid #D9D9D9; border-radius: 6px; padding: 0 10px;
  font-size: 15px; color: var(--text); background: #fff; outline: none; font-family: inherit;
}
.query-card .q-month:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31,78,121,.12); }
.query-card .qc-btn { width: auto; height: 40px; line-height: 40px; padding: 0 18px; font-size: 15px; }

/* 历史列表 */
.section-title { font-size: 14px; color: var(--text-2); margin: 4px 4px 8px; font-weight: 600; }
.row-item {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border-radius: 10px; padding: 14px 16px;
  box-shadow: var(--shadow); margin-bottom: 8px; cursor: pointer;
}
.row-item:active { background: #F0F5FA; }
.row-item .ri-month { font-size: 15px; font-weight: 600; }
.row-item .ri-right { display: flex; align-items: center; gap: 8px; }
.row-item .ri-amount { font-size: 16px; font-weight: 700; color: var(--accent); }
.row-item .ri-arrow svg { width: 18px; height: 18px; color: var(--text-3); }

/* 详情 */
.detail-summary {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 16px; text-align: center; margin-bottom: 12px;
}
.detail-summary .ds-label { font-size: 13px; color: var(--text-2); }
.detail-summary .ds-amount { font-size: 32px; font-weight: 700; color: var(--accent); margin: 6px 0; }
.detail-summary .ds-sub { display: flex; justify-content: space-around; font-size: 13px; color: var(--text-2); margin-top: 8px; }
.detail-summary .ds-sub b { color: var(--text); font-weight: 600; display: block; font-size: 15px; margin-top: 2px; }

.group-title { font-size: 13px; color: var(--text-2); margin: 12px 4px 6px; font-weight: 600; }
.detail-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 16px; background: #fff; border-bottom: 1px solid #F0F0F0; font-size: 14px;
}
.detail-row:first-of-type { border-radius: 10px 10px 0 0; }
.detail-row:last-of-type { border-radius: 0 0 10px 10px; border-bottom: none; }
.detail-row .dr-name { color: var(--text); }
.detail-row .dr-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.detail-row.income .dr-val { color: var(--text); }
.detail-row.deduct .dr-val { color: var(--danger); }
.hr-tip {
  text-align: center; color: var(--text-3); font-size: 12px;
  padding: 14px; background: #fff; border-radius: 10px; box-shadow: var(--shadow); margin-top: 12px;
}

/* 个人中心 */
.me-head {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; display: flex; align-items: center; gap: 14px; margin-bottom: 12px;
}
.me-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--primary-bg); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700;
}
.me-name { font-size: 17px; font-weight: 700; }
.me-id { font-size: 13px; color: var(--text-3); margin-top: 4px; letter-spacing: 1px; }
.menu-item {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; padding: 15px 16px; box-shadow: var(--shadow);
  margin-bottom: 8px; cursor: pointer; font-size: 15px; border-radius: 10px;
}
.menu-item:active { background: #F0F5FA; }
.menu-item .mi-left { display: flex; align-items: center; gap: 10px; color: var(--text); }
.menu-item .mi-left svg { width: 20px; height: 20px; color: var(--primary); }
.menu-item .mi-arrow svg { width: 18px; height: 18px; color: var(--text-3); }

/* 底部 Tab */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: 56px; background: #fff; border-top: 1px solid var(--border);
  display: flex; z-index: 30;
}
.tabbar .tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 12px; cursor: pointer; gap: 2px;
}
.tabbar .tab svg { width: 22px; height: 22px; }
.tabbar .tab.active { color: var(--primary); }
.tabbar .tab.active svg { color: var(--primary); }

/* 空状态 */
.empty { text-align: center; color: var(--text-3); padding: 48px 16px; }
.empty svg { width: 56px; height: 56px; opacity: .4; margin-bottom: 12px; }
.empty .e-tip { font-size: 13px; margin-top: 4px; }

/* Toast */
.toast {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,.8); color: #fff; padding: 10px 18px; border-radius: 8px;
  font-size: 14px; z-index: 100; max-width: 80%; text-align: center;
}
.toast.ok { background: rgba(84,130,53,.95); }
.toast.err { background: rgba(192,0,0,.92); }

/* 全屏遮罩 loading */
.loading-mask {
  position: fixed; inset: 0; background: rgba(255,255,255,.5);
  display: flex; align-items: center; justify-content: center; z-index: 90;
}
.spinner {
  width: 32px; height: 32px; border: 3px solid var(--primary-bg);
  border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 骨架屏 */
.skeleton { background: linear-gradient(90deg,#eee,#f5f5f5,#eee); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 6px; }
@keyframes sk { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* Modal */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 80;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: #fff; width: 100%; max-width: 480px; border-radius: 16px 16px 0 0;
  padding: 20px 16px 24px; animation: slideUp .2s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal h3 { margin: 0 0 16px; font-size: 17px; font-weight: 700; text-align: center; }
.modal .modal-actions { display: flex; gap: 12px; margin-top: 20px; }
.modal .modal-actions .btn { flex: 1; }
.modal .btn.secondary { margin-top: 0; }
.modal-text { font-size: 14px; color: var(--text-2); line-height: 1.7; }

/* ===== 工资条签收 ===== */
.sign-box { margin: 18px 0 8px; text-align: center; }
.btn-sign {
  width: 100%; height: 46px; border: none; border-radius: 10px;
  background: #1F4E79; color: #fff; font-size: 16px; font-weight: 600;
  cursor: pointer; letter-spacing: .5px;
}
.btn-sign:active { background: #17395a; }
.btn-sign:disabled { background: #9fb3c6; }
.sign-tip { margin-top: 8px; font-size: 12px; color: #8C8C8C; }
.sign-box.signed {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: #E8F5E9; color: #548235; border-radius: 10px;
  padding: 12px; font-size: 14px;
}
.sign-box.signed svg { width: 20px; height: 20px; }
