/* ===== 宸鑫服饰扫码报工系统 全局样式 ===== */
:root {
  --brand: #1f6feb;
  --brand-dark: #1557b0;
  --bg: #f3f6fa;
  --card: #ffffff;
  --text: #1c2733;
  --muted: #6b7785;
  --line: #e3e9f0;
  --ok: #1a7f37;
  --warn: #b54708;
  --danger: #c0392b;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.container { max-width: 960px; margin: 0 auto; padding: 16px; }

/* 顶栏 */
.topbar {
  background: var(--brand);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar h1 { font-size: 18px; font-weight: 600; }
.topbar .sub { font-size: 12px; opacity: .85; }
.topbar a { color: #fff; text-decoration: none; font-size: 14px; }
.brand-wrap { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 34px; height: 34px; border-radius: 9px; background: #fff; object-fit: cover; }
@media (max-width: 600px) { .brand-logo { width: 30px; height: 30px; } }

/* 卡片 */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}
.card h2 { font-size: 16px; margin-bottom: 12px; }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; margin-bottom: 6px; color: var(--text); }
.form-group label .req { color: var(--danger); }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}
.form-group textarea { resize: vertical; min-height: 72px; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31,111,235,.15);
}

/* 已登录身份条 */
.login-badge {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #f2f7ff; border: 1px solid #dbe8fb; border-radius: 12px;
  padding: 12px 14px; margin-bottom: 16px;
}
.login-badge .lb-title { font-size: 12px; color: var(--muted); }
.login-badge .lb-name { font-size: 16px; font-weight: 600; color: var(--text); margin-top: 2px; }
.login-badge .lb-no { font-size: 13px; color: var(--brand); font-weight: 500; margin-left: 8px; }
.login-badge a { font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; white-space: nowrap; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: #1f6feb;
  color: #fff;
  width: 100%;
  text-decoration: none;
  transition: background .12s ease, transform .12s ease;
}
.btn:hover { background: #1557b0; }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: #eef2f7; color: var(--text); }
.btn.secondary:active { transform: translateY(1px); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn.sm { width: auto; padding: 7px 14px; font-size: 14px; font-weight: 500; }
.btn-main { display: flex; width: auto; min-width: 180px; margin: 0 auto; }

/* 提示条 */
.toast {
  position: fixed; left: 50%; top: 18%; transform: translateX(-50%);
  padding: 12px 20px; border-radius: 10px; font-size: 15px; color: #fff;
  z-index: 999; display: none; max-width: 80%; text-align: center;
}
.toast.ok { background: var(--ok); }
.toast.err { background: var(--danger); }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { background: #f8fafc; border-radius: 10px; padding: 14px; text-align: center; }
.stat .num { font-size: 22px; font-weight: 700; color: var(--brand); }
.stat .label { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
tr:hover td { background: #f8fafc; }

/* 筛选行 */
.filter-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filter-row .btn { width: auto; }

/* 订单工序明细行 */
.proc-rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.proc-row { display: flex; gap: 8px; align-items: center; }
.proc-row select { flex: 1.3; }
.proc-row input { flex: 1; }
.proc-row .op-qty { flex: 0.9; }
.proc-row .op-del { flex: 0 0 auto; color: var(--danger); }
.proc-empty { font-size: 13px; color: var(--muted); padding: 8px 0; }
.filter-row input, .filter-row select {
  padding: 10px; font-size: 15px; border: 1px solid var(--line); border-radius: 10px;
}
.filter-row .spacer { flex: 1; }

/* 我的工资：当前账号条（两排布局） */.account-bar {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 12px; margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.account-main { min-width: 0; flex: 1; }
.acc-label { font-size: 12px; color: var(--muted); line-height: 1.2; }
.acc-line {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 8px;
  margin-top: 5px; min-width: 0;
}
.acc-no {
  font-size: 15px; font-weight: 600; color: var(--brand);
  background: #eaf2fe; border-radius: 8px; padding: 2px 9px;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.acc-name {
  font-size: 17px; font-weight: 600; color: var(--text);
  min-width: 0; overflow-wrap: anywhere; line-height: 1.3;
}
.account-bar .btn { flex: 0 0 auto; white-space: nowrap; }
.month-row { gap: 10px; }
.month-row input[type="month"] { flex: 1; min-width: 0; }

/* 后台工资统计：可点行 + 明细链接 */
.salary-row:hover { background: #f6faff; }
.detail-link { color: var(--brand); font-size: 13px; white-space: nowrap; }
.salary-row:hover .detail-link { text-decoration: underline; }

/* 订单状态标签切换 */
.order-tabs .otab {
  background: #eef2f7; border: 1px solid transparent; color: var(--text);
}
.order-tabs .otab:hover { background: #e2e9f2; }
.order-tabs .otab.active {
  background: var(--brand); color: #fff; border-color: var(--brand);
}
.order-tabs .otab.active:hover { background: var(--brand); }

/* 二维码区 */
.qr-box { text-align: center; padding: 10px 0; }
.qr-box img { width: 220px; height: 220px; border: 1px solid var(--line); border-radius: 12px; }
.qr-box .url { margin-top: 12px; color: var(--muted); font-size: 13px; word-break: break-all; }

.empty { text-align: center; color: var(--muted); padding: 30px 0; font-size: 14px; }

/* 登录页 */
.login-wrap { max-width: 360px; margin: 12vh auto; padding: 0 16px; }

@media (min-width: 768px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
}

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,25,40,.45);
  display: flex; justify-content: center; align-items: flex-start;
  z-index: 1000; padding: 16px;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.modal-box {
  background: #fff; border-radius: 14px; padding: 22px;
  width: 100%; max-width: 480px; margin: auto 0;
}
.modal-box h2 { font-size: 17px; margin-bottom: 16px; }

/* 手机端：工序行允许换行，避免挤压到看不见 */
@media (max-width: 560px) {
  .proc-row { flex-wrap: wrap; }
  .proc-row select { flex: 1 1 100%; }
  .proc-row input { flex: 1 1 42%; }
  .proc-row .op-del { flex: 0 0 auto; }
  .modal-box { padding: 18px; }
}

/* ===== 首页立体入口卡片 ===== */
.entry-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
.entry {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 18px;
  border-radius: 18px;
  text-decoration: none;
  color: #fff;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.entry::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(120deg, rgba(255,255,255,.22), transparent 55%);
  pointer-events: none;
}
.entry:hover { transform: translateY(-3px); filter: brightness(1.06); }
.entry:active { transform: translateY(1px); }

.entry-icon {
  flex: 0 0 52px;
  width: 52px; height: 52px;
  border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 4px 10px rgba(0,0,0,.15);
}
.entry-icon svg { width: 28px; height: 28px; }
.entry-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.entry-title { font-size: 18px; font-weight: 700; letter-spacing: .5px; }
.entry-sub { font-size: 13px; opacity: .88; }

.entry-primary {
  background: linear-gradient(135deg, #2b7df0 0%, #1f6feb 55%, #1557b0 100%);
  box-shadow: 0 10px 22px rgba(31,111,235,.35), inset 0 1px 0 rgba(255,255,255,.25);
}
.entry-gold {
  background: linear-gradient(135deg, #f7b955 0%, #f59e0b 55%, #d97706 100%);
  box-shadow: 0 10px 22px rgba(217,119,6,.32), inset 0 1px 0 rgba(255,255,255,.28);
}
.entry-dark {
  background: linear-gradient(135deg, #33465c 0%, #223247 55%, #16222f 100%);
  box-shadow: 0 10px 22px rgba(22,34,47,.38), inset 0 1px 0 rgba(255,255,255,.18);
}

@media (min-width: 768px) {
  .entry-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ===== 后台主区 ===== */
.admin-layout { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
.admin-main { min-width: 0; }
.salary-total { margin-top: 12px; font-size: 14px; font-weight: 600; color: var(--text); }

/* ===== 手机简化版后台 ===== */
.madmin .stat-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
.madmin .stat { padding: 12px 8px; }
.madmin .stat .num { font-size: 20px; }
.m-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.m-card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.m-card-title h2 { font-size: 16px; }
.m-card-title .spacer { flex: 1; }
.m-list { display: flex; flex-direction: column; gap: 12px; }
.m-item { border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; background: #fafcfe; }
.m-item-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.m-name { font-size: 16px; font-weight: 600; }
.m-name .sub { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.m-amount { font-size: 16px; font-weight: 700; color: var(--brand); white-space: nowrap; }
.m-meta { font-size: 13px; color: var(--muted); margin-top: 5px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.m-meta b { color: var(--text); font-weight: 500; }
.m-ops { display: flex; gap: 10px; margin-top: 11px; }
.m-ops .btn { flex: 1; padding: 11px 0; font-size: 15px; }
.m-progress { margin-top: 9px; }
.m-bar { height: 8px; border-radius: 6px; background: #e9eff6; overflow: hidden; }
.m-bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #2b7df0, #1f6feb); }
.m-proc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.m-tag { font-size: 12px; color: var(--brand); background: #eaf2fe; border-radius: 8px; padding: 3px 9px; }
.m-order-no { font-size: 15px; font-weight: 600; }
.m-status { font-size: 12px; border-radius: 8px; padding: 3px 9px; }
.m-status.open { color: var(--ok); background: #e7f4ec; }
.m-status.done, .m-status.closed { color: var(--muted); background: #eef2f7; }
.m-salary-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; gap: 10px; }
.m-salary-row:last-child { border-bottom: none; }
.m-salary-amt { font-weight: 700; color: var(--brand); white-space: nowrap; }
.m-hint { font-size: 13px; color: var(--muted); background: #f8fafc; border: 1px dashed var(--line); border-radius: 12px; padding: 14px; line-height: 1.7; }
.m-hint a { color: var(--brand); }
.m-nav { display: flex; gap: 8px; }
.m-nav a { font-size: 13px; border: 1px solid rgba(255,255,255,.4); border-radius: 8px; padding: 6px 10px; }
