/* RFID 仓库盘库系统 - 白底淡蓝简约风（美化升级版） */
:root {
  --primary: #3E7BFA;
  --primary-dark: #2C5FC7;
  --primary-light: #EAF2FE;
  --primary-border: #BBD3FB;
  --bg: #F4F7FC;
  --card: #FFFFFF;
  --text: #24324A;
  --text-sub: #7A8AA8;
  --border: #E4EAF3;
  --green: #22A06B;
  --red: #E5484D;
  --orange: #F59E0B;
  --purple: #7C5CFC;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(16,35,69,.05), 0 2px 8px rgba(16,35,69,.04);
  --shadow-md: 0 2px 6px rgba(16,35,69,.06), 0 10px 28px rgba(16,35,69,.08);
  --shadow-lg: 0 8px 20px rgba(16,35,69,.10), 0 24px 64px rgba(16,35,69,.14);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 13px; color: var(--text); background: var(--bg);
  background-image: radial-gradient(1200px 500px at 85% -10%, rgba(62,123,250,.06), transparent 60%),
                    radial-gradient(900px 420px at -10% 110%, rgba(124,92,252,.05), transparent 60%);
  background-attachment: fixed;
}
.hidden { display: none !important; }
.ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.ic.lg { width: 40px; height: 40px; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #C6D2E6; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #A9BACE; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 登录 ---------- */
.login-wrap {
  height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #EAF2FE 0%, #F5F8FC 55%, #DCE9FB 100%);
  position: relative; overflow: hidden;
}
.login-wrap::before, .login-wrap::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(10px); pointer-events: none;
}
.login-wrap::before { width: 420px; height: 420px; left: -120px; top: -140px; background: radial-gradient(circle, rgba(62,123,250,.18), transparent 70%); }
.login-wrap::after { width: 520px; height: 520px; right: -160px; bottom: -200px; background: radial-gradient(circle, rgba(124,92,252,.14), transparent 70%); }
.login-card {
  width: 380px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.8); border-radius: 18px; padding: 42px 38px 34px;
  box-shadow: var(--shadow-lg); position: relative; z-index: 1;
  animation: rise .5s cubic-bezier(.22,.9,.36,1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); } }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .ic.lg {
  color: var(--primary); filter: drop-shadow(0 6px 14px rgba(62,123,250,.35));
  background: linear-gradient(135deg, var(--primary-light), #fff); border-radius: 16px; padding: 14px; box-sizing: content-box; width: 34px; height: 34px; display: inline-block;
}
.login-logo h1 { font-size: 21px; margin-top: 14px; letter-spacing: 1px; }
.login-logo p { color: var(--text-sub); font-size: 11px; margin-top: 4px; letter-spacing: .5px; }
.login-err { color: var(--red); text-align: center; margin-top: 12px; font-size: 12px; }

/* ---------- 布局 ---------- */
#main-page { display: flex; height: 100vh; }
.sidebar {
  width: 208px;
  background: linear-gradient(180deg, #2447A8 0%, #2C5FC7 45%, #3570DC 100%);
  display: flex; flex-direction: column; flex-shrink: 0;
  box-shadow: 2px 0 16px rgba(28,58,130,.25);
}
.side-logo {
  height: 58px; display: flex; align-items: center; gap: 9px; padding: 0 18px;
  font-weight: 700; font-size: 15px; color: #FFFFFF; border-bottom: 1px solid rgba(255,255,255,.18);
  letter-spacing: .5px;
}
.side-logo .ic { color: #2C5FC7; background: #FFFFFF; padding: 6px; box-sizing: content-box; width: 16px; height: 16px; border-radius: 9px; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
#side-nav { flex: 1; padding: 10px 10px; overflow-y: auto; }
#side-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); }
#side-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.4); }
#side-nav a {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 13px; border-radius: 9px;
  color: rgba(255,255,255,.82); cursor: pointer; margin-bottom: 2px; font-size: 13.5px;
  transition: background .15s, color .15s;
}
#side-nav a:hover { background: rgba(255,255,255,.14); color: #FFFFFF; }
#side-nav a.active { background: #FFFFFF; color: var(--primary-dark); font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.22); }
#side-nav a.active::before {
  content: ""; position: absolute; left: 0; top: 22%; bottom: 22%; width: 3px; border-radius: 2px;
  background: linear-gradient(180deg, #3E7BFA, #6C9CFF);
}
.side-foot { border-top: 1px solid rgba(255,255,255,.18); padding: 12px 14px; }
.whoami { color: rgba(255,255,255,.75); font-size: 12px; margin-bottom: 7px; }
.side-foot a { color: rgba(255,255,255,.75); cursor: pointer; font-size: 12.5px; display: inline-flex; gap: 6px; align-items: center; transition: color .15s; }
.side-foot a:hover { color: #FFD7D9; }
.content { flex: 1; overflow-y: auto; padding: 20px 24px 28px; }

/* ---------- 通用组件 ---------- */
.page-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
  padding: 14px 18px; background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.page-head > div:first-child { position: relative; padding-left: 14px; }
.page-head > div:first-child::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 4px; border-radius: 2px;
  background: linear-gradient(180deg, #3E7BFA, #6C9CFF);
}
.page-title { font-size: 17px; font-weight: 700; letter-spacing: .3px; }
.page-sub { color: var(--text-sub); font-size: 12px; margin-top: 3px; }
.card {
  background: var(--card); border-radius: var(--radius); border: 1px solid var(--border);
  padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
}
.card-title {
  font-size: 14px; font-weight: 600; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center;
}

.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border);
  background: #FFF; color: var(--text); padding: 7px 14px; border-radius: 9px;
  font-size: 13px; cursor: pointer; transition: all .15s ease; box-shadow: var(--shadow-sm);
}
.btn:hover { border-color: var(--primary); color: var(--primary); background: #F5F9FF; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(62,123,250,.15); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(135deg, #3E7BFA, #5B8FFC); border-color: transparent; color: #FFF;
  box-shadow: 0 4px 14px rgba(62,123,250,.3);
}
.btn.primary:hover { background: linear-gradient(135deg, #2C5FC7, #3E7BFA); color: #FFF; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(62,123,250,.38); }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); background: #FFF5F5; color: var(--red); }
.btn.sm { padding: 4px 11px; font-size: 12px; border-radius: 7px; box-shadow: none; }
.btn.sm:hover { transform: none; }
.btn.block { width: 100%; justify-content: center; padding: 11px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

input, select, textarea {
  border: 1px solid var(--border); border-radius: 9px; padding: 7px 11px;
  font-size: 13px; color: var(--text); outline: none; background: #FFF; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(62,123,250,.14); }
.form-item { margin-bottom: 14px; }
.form-item label { display: block; font-size: 12.5px; color: var(--text-sub); margin-bottom: 5px; }
.form-item input, .form-item select, .form-item textarea { width: 100%; }
.form-row { display: flex; gap: 12px; }
.form-row .form-item { flex: 1; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 12.5px; white-space: nowrap; }
th {
  color: #5A6B8C; font-weight: 600; background: #FAFBFE; position: sticky; top: 0; z-index: 1;
  font-size: 12px; letter-spacing: .3px; box-shadow: 0 1px 0 var(--border);
}
tbody tr { transition: background .12s; }
tbody tr:hover { background: #F6F9FF; }
tbody tr:last-child td { border-bottom: none; }
.table-wrap { overflow: auto; max-height: calc(100vh - 280px); border: 1px solid var(--border); border-radius: 10px; background: #FFF; }
.tag-badge {
  display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 11.5px; line-height: 1.7;
  border: 1px solid transparent;
}
.tag-badge.blue { background: var(--primary-light); color: var(--primary); border-color: rgba(62,123,250,.18); }
.tag-badge.green { background: #E6F6EF; color: var(--green); border-color: rgba(34,160,107,.18); }
.tag-badge.red { background: #FDEBEC; color: var(--red); border-color: rgba(229,72,77,.18); }
.tag-badge.orange { background: #FEF3E2; color: #B45309; border-color: rgba(245,158,11,.22); }
.tag-badge.gray { background: #F0F2F6; color: #5A6B8C; border-color: rgba(90,107,140,.15); }
.mono { font-family: Consolas, monospace; font-size: 12px; letter-spacing: .3px; }

.toolbar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { width: auto; }
.toolbar .grow { flex: 1; }

/* 统计卡片 */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; display: flex; gap: 13px; align-items: center;
  box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-num { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.stat-label { color: var(--text-sub); font-size: 12px; margin-top: 2px; }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-card .ic { width: 21px; height: 21px; }
.stat-card.c-blue .stat-icon { background: var(--primary-light); color: var(--primary); }
.stat-card.c-blue .stat-num { color: var(--primary); }
.stat-card.c-green .stat-icon { background: #E6F6EF; color: var(--green); }
.stat-card.c-green .stat-num { color: var(--green); }
.stat-card.c-orange .stat-icon { background: #FEF3E2; color: #B45309; }
.stat-card.c-orange .stat-num { color: #B45309; }
.stat-card.c-red .stat-icon { background: #FDEBEC; color: var(--red); }
.stat-card.c-red .stat-num { color: var(--red); }
.stat-card.c-purple .stat-icon { background: #F0EBFF; color: var(--purple); }
.stat-card.c-purple .stat-num { color: var(--purple); }
.low { color: var(--red); font-weight: 700; }

/* 快捷入口 */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.quick-item {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px 16px; cursor: pointer; display: flex; gap: 12px; align-items: center;
  box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.quick-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary-border); }
.quick-item .ic { width: 20px; height: 20px; }
.quick-item .q-icon { width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.quick-item .q-title { font-weight: 600; font-size: 13.5px; }
.quick-item .q-desc { color: var(--text-sub); font-size: 11.5px; margin-top: 2px; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20,30,50,.45); backdrop-filter: blur(3px); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding-top: 7vh;
  animation: fadein .18s ease both;
}
.modal {
  background: #FFF; border-radius: 14px; width: 520px; max-width: 94vw;
  max-height: 84vh; overflow-y: auto; padding: 20px 22px; box-shadow: var(--shadow-lg);
  animation: pop .22s cubic-bezier(.22,.9,.36,1) both;
}
.modal.wide { width: 780px; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.modal h3 { font-size: 15px; margin-bottom: 16px; position: relative; padding-left: 12px; }
.modal h3::before { content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 4px; border-radius: 2px; background: linear-gradient(180deg, #3E7BFA, #6C9CFF); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* Toast */
#toast-box { position: fixed; top: 18px; right: 20px; z-index: 200; display: flex; flex-direction: column; align-items: flex-end; }
.toast {
  background: #2B3548; color: #FFF; padding: 10px 18px; border-radius: 10px; margin-bottom: 8px;
  font-size: 13px; box-shadow: var(--shadow-lg); animation: toastin .25s cubic-bezier(.22,.9,.36,1) both;
  max-width: 380px;
}
.toast.err { background: linear-gradient(135deg, #E5484D, #C9383C); }
.toast.ok { background: linear-gradient(135deg, #22A06B, #1B8A5A); }
@keyframes toastin { from { opacity: 0; transform: translateX(24px); } }

/* 盘库进度 */
.progress-bar { height: 9px; background: var(--primary-light); border-radius: 5px; overflow: hidden; }
.progress-bar > div {
  height: 100%; border-radius: 5px; transition: width .4s ease;
  background: linear-gradient(90deg, #3E7BFA, #6C9CFF); position: relative;
}
.progress-bar > div::after {
  content: ""; position: absolute; inset: 0; border-radius: 5px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  background-size: 200% 100%; animation: sheen 2.4s linear infinite;
}
@keyframes sheen { from { background-position: 180% 0; } to { background-position: -80% 0; } }
.diff-section { margin-bottom: 6px; }
.diff-section h4 { font-size: 13px; margin: 12px 0 8px; color: var(--text-sub); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 14px; }
.tabs a {
  padding: 10px 18px; cursor: pointer; color: var(--text-sub); border-bottom: 2px solid transparent;
  margin-bottom: -2px; font-size: 13.5px; border-radius: 8px 8px 0 0; transition: all .15s;
}
.tabs a:hover { color: var(--primary); background: #F5F9FF; }
.tabs a.active {
  color: var(--primary); border-color: var(--primary); font-weight: 600;
  background: linear-gradient(180deg, rgba(234,242,254,.6), transparent);
}

.empty { text-align: center; color: var(--text-sub); padding: 36px 0; }
.empty .ic { width: 32px; height: 32px; margin-bottom: 8px; opacity: .35; }
