/* ============ 基础 ============ */
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 14px;
  color: #333;
  background: #f3f3f4;
}
a { text-decoration: none; color: #1e9fff; cursor: pointer; }
a:hover { color: #0c7cd5; }
ul, ol, li, dl, dd, h1, h2, h3, h4, h5, p { margin: 0; padding: 0; list-style: none; }
img { border: 0; }
.clearfix::after { content: ""; display: block; clear: both; }
::-webkit-scrollbar { width: 8px; height: 8px; background: #f5f5f5; }
::-webkit-scrollbar-thumb { background: #bbb; border-radius: 6px; }
::-webkit-scrollbar-track { background: #f5f5f5; }

/* ============ 登录页 ============ */
.login-body {
  background: #3d70c6;
  min-height: 100vh;
  overflow-x: hidden;
}
.login-topbar {
  height: 70px;
  display: flex;
  align-items: center;
  padding: 0 40px;
  color: #fff;
}
.login-logo {
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,255,255,.16);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: #fff; margin-right: 12px;
}
.login-brand { font-size: 24px; font-weight: bold; letter-spacing: 1px; }
.login-divider { width: 1px; height: 24px; background: rgba(255,255,255,.6); margin: 0 20px; }
.login-slogan { font-size: 16px; opacity: .95; }
.login-service { margin-left: auto; font-size: 15px; }
.login-service a { color: #fff; }
.login-main {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 60px;
  padding: 40px 40px 80px;
  max-width: 1280px;
  margin: 0 auto;
}
.login-hero { color: #fff; padding-top: 40px; width: 600px; }
.login-hero h1 { font-size: 42px; font-weight: bold; letter-spacing: 2px; margin-bottom: 28px; }
.login-hero .feature { font-size: 17px; line-height: 2.6; letter-spacing: 3px; opacity: .95; }
.login-stats {
  display: flex; margin-top: 40px; padding: 22px 0;
  background: rgba(255,255,255,.1); border-radius: 6px;
}
.login-stats .stat { flex: 1; text-align: center; border-right: 1px solid rgba(255,255,255,.25); }
.login-stats .stat:last-child { border-right: 0; }
.login-stats .num { font-size: 34px; font-weight: bold; }
.login-stats .num small { font-size: 15px; font-weight: normal; }
.login-stats .label { font-size: 13px; opacity: .85; margin-top: 4px; }
.login-card {
  width: 400px; background: #fff; border-radius: 4px;
  padding: 30px 0 0; box-shadow: 0 10px 40px rgba(0,0,0,.18);
  flex: 0 0 400px;
}
.login-card h2 {
  color: #1e97ee; font-size: 28px; text-align: center;
  font-weight: normal; margin-bottom: 26px; letter-spacing: 2px;
}
.login-field {
  margin: 0 60px 18px; border: 1px solid #ccc; border-radius: 4px;
  display: flex; align-items: center; height: 42px; padding: 0 10px;
  transition: border-color .2s;
}
.login-field:focus-within { border-color: #1e97ee; }
.login-field i { font-size: 20px; color: #bbb; margin-right: 8px; }
.login-field input {
  border: 0; outline: none; flex: 1; height: 38px; font-size: 15px; color: #333;
  background: transparent;
}
.login-row {
  margin: 6px 60px 22px; display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; color: #333;
}
.login-row label { cursor: pointer; display: flex; align-items: center; gap: 6px; }
.login-btn {
  display: block; width: 280px; height: 42px; margin: 0 auto;
  background: #1e9fff; color: #fff; border: 0; border-radius: 4px;
  font-size: 17px; cursor: pointer; letter-spacing: 6px;
  transition: background .2s;
}
.login-btn:hover { background: #0c8ce8; }
.login-foot {
  text-align: center; font-size: 13px; color: #666; margin-top: 30px;
  padding-bottom: 26px;
}
.login-foot a { color: #0e87de; }
.login-copyright { text-align: center; color: rgba(255,255,255,.55); font-size: 12px; padding: 20px 0 30px; }
.login-mobile-tip { display: none; }

/* ============ 后台框架 ============ */
.shell { height: 100vh; overflow: hidden; }
.rail {
  position: fixed; left: 0; top: 0; bottom: 0; width: 100px;
  background-image: linear-gradient(#187ee7, #288ef7, #389ef7);
  z-index: 1000; color: #fff;
}
.rail-logo { height: 58px; display: flex; align-items: center; justify-content: center; }
.rail-logo .logo-circle {
  width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.rail-name { text-align: center; font-size: 17px; font-family: KaiTi, "Microsoft YaHei"; margin-bottom: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 6px; }
.rail-foot > div:last-child { max-width: 92px; margin: 0 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-nav { height: calc(100vh - 190px); overflow: hidden; }
.rail-item { position: relative; height: 65px; cursor: pointer; }
.rail-item > a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 65px; color: #fff; gap: 5px;
}
.rail-item > a i { font-size: 22px; }
.rail-item > a span { font-size: 14px; }
.rail-item:hover { background: #086ed7; }
.rail-item:hover > a { color: #fff; }
.rail-foot {
  position: absolute; bottom: 0; left: 0; right: 0; text-align: center;
  font-size: 10px; color: rgba(255,255,255,.8); padding-bottom: 8px;
}
.rail-foot .skin { display: flex; justify-content: center; gap: 6px; margin-bottom: 8px; }
.rail-foot .skin span {
  border: 1px solid rgba(255,255,255,.6); padding: 1px 4px; border-radius: 2px; cursor: pointer;
  font-size: 10px;
}
.rail-foot .skin span.on { background: #fff; color: #187ee7; }

.power {
  display: none; position: fixed; left: 100px; z-index: 1100;
  background: #fff; border-top: 3px solid #187ee7;
  border-right: 1px solid #ccc; border-bottom: 1px solid #ccc;
  box-shadow: 3px 3px 10px rgba(0,0,0,.3);
  padding: 10px 14px; min-width: 230px; max-height: 78vh; overflow-y: auto;
}
.rail-item:hover .power { display: block; }
.power::before { content: ""; position: absolute; left: -8px; top: 0; bottom: 0; width: 8px; }
.power-row { display: flex; align-items: center; height: 40px; min-width: 200px; }
.power-row > a.main {
  flex: 1; color: #333; font-size: 14px; padding: 0 10px; height: 32px; line-height: 32px;
  border-radius: 3px; white-space: nowrap;
}
.power-row > a.main:hover { background: #5ecfff; color: #fff; }
.power-add {
  background: #63c963; color: #fff !important; border-radius: 4px;
  font-size: 12px; padding: 4px 10px; margin-left: 8px; white-space: nowrap;
}
.power-add:hover { background: #4fb84f; }
.power.reps { width: 900px; column-count: 4; column-gap: 14px; }
.power.sets { width: 700px; column-count: 3; column-gap: 14px; }
.power.reps .power-row, .power.sets .power-row { break-inside: avoid; min-width: 0; }

.topbar {
  position: fixed; left: 100px; right: 0; top: 0; height: 50px; background: #fff;
  z-index: 900; display: flex; align-items: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.topbar .brand {
  font-size: 22px; font-weight: bold; color: #333; margin-left: 20px;
  max-width: 460px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topnav { margin-left: auto; display: flex; height: 50px; align-items: stretch; }
.topnav > li { display: flex; }
.topnav > li > a {
  display: flex; align-items: center; gap: 4px; padding: 0 13px; color: #333; font-size: 14px;
}
.topnav > li > a:hover { background: #eee; color: #333; }
.topnav .user-name { color: #1e9fff; padding-right: 26px; }

.workspace {
  position: fixed; left: 100px; right: 0; top: 50px; bottom: 0; background: #f3f3f4;
  display: flex; flex-direction: column;
}
.tabbar {
  height: 40px; background: #fff; border-bottom: 1px solid #e6e6e6;
  display: flex; align-items: stretch; overflow: hidden; position: relative; flex: 0 0 40px;
}
.tabbar ul.tabs { display: flex; flex: 1; overflow-x: auto; overflow-y: hidden; }
.tabbar ul.tabs::-webkit-scrollbar { height: 0; }
.tabbar .tab {
  display: flex; align-items: center; gap: 6px; padding: 0 10px 0 14px;
  border-right: 1px solid #eee; color: #555; cursor: pointer; white-space: nowrap; font-size: 13px;
  max-width: 200px;
}
.tabbar .tab .title { overflow: hidden; text-overflow: ellipsis; }
.tabbar .tab.active { background: #ebebeb; color: #1e9fff; }
.tabbar .tab .close {
  font-size: 14px; color: #999; border-radius: 50%; width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
}
.tabbar .tab .close:hover { background: #f56c6c; color: #fff; }
.tabbar .tab-actions { display: flex; align-items: center; padding: 0 12px; color: #999; cursor: pointer; }
.tabbar .tab-actions:hover { color: #1e9fff; }
.tab-context {
  position: fixed; background: #fff; border: 1px solid #eee; box-shadow: 0 2px 10px rgba(0,0,0,.15);
  z-index: 9999; display: none; min-width: 100px; padding: 4px 0;
}
.tab-context div { padding: 6px 16px; cursor: pointer; font-size: 13px; }
.tab-context div:hover { background: #eee; }
.iframe-wrap { position: relative; flex: 1; padding: 10px 12px 0; }
.iframe-wrap iframe {
  width: 100%; height: 100%; border: 0; background: #f3f3f4; display: block;
}

/* ============ 页面通用 ============ */
.page { padding: 0; }
.form_box {
  background: #fff; border-radius: 2px; box-shadow: 0 1px 5px rgba(0,0,0,.1);
  padding: 12px; min-height: calc(100vh - 60px); min-width: 820px;
}
.button-row { text-align: right; padding-right: 20px; }
.button-row .layui-btn { margin-left: 6px; }
.layui-form-item { margin-bottom: 6px; }
.layui-form-label { width: 88px; padding: 9px 8px; font-size: 13px; }
.layui-input-block { margin-left: 88px; }
.layui-form-pane .layui-input, .layui-form-pane .layui-select { height: 34px; line-height: 34px; }
.layui-form-pane .layui-form-label { height: 34px; line-height: 18px; }
.layui-btn-sm { font-size: 13px !important; }
.layui-table-cell { padding: 0 10px; }
.layui-table-view { margin: 0; }
.layui-table-total { font-weight: bold; }

/* 报表/单据合计栏 */
.summary-bar {
  background: #f8f8f8; border: 1px solid #eee; padding: 9px 14px; margin: 8px 0;
  font-size: 13px; color: #666; display: flex; flex-wrap: wrap; gap: 22px;
}
.summary-bar b { color: #1e9fff; font-size: 15px; }
.summary-bar .danger { color: #ff5722; }

/* 开单页 */
.bill-toolbar {
  position: sticky; top: 0; z-index: 100; text-align: right;
  padding: 6px 4px; background: rgba(0,0,0,.03); margin: -12px -12px 10px;
}
.bill-toolbar .layui-btn { margin-left: 5px; }
.bill-head { margin-bottom: 6px; }
.bill-item-table { margin-top: 4px; }
.total-panel { margin-top: 10px; }
.total-panel .layui-form-label { width: 96px; }
.total-panel .layui-input-block { margin-left: 96px; }
.money-strong { color: #ff5722; font-weight: bold; }
.required-star { color: red; }

/* 登录页响应式 */
@media (max-width: 1100px) {
  .login-hero { display: none; }
  .login-main { justify-content: center; }
}
@media (max-width: 520px) {
  .login-card { width: calc(100vw - 30px); flex: 1 1 auto; }
  .login-field, .login-row { margin-left: 24px; margin-right: 24px; }
  .login-btn { width: calc(100% - 48px); }
  .login-topbar { padding: 0 16px; }
  .login-slogan, .login-divider { display: none; }
}

/* 打印 */
.print-body { background: #fff; padding: 18px; }
.print-page { width: 210mm; min-height: 297mm; margin: 0 auto; background: #fff; padding: 8mm; }
.print-title { text-align: center; font-size: 24px; font-weight: bold; letter-spacing: 4px; margin: 10px 0 6px; }
.print-company { text-align: center; font-size: 14px; color: #333; margin-bottom: 10px; }
.print-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 12px; margin: 8px 0; }
.print-meta span { min-width: 150px; }
.print-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.print-table th, .print-table td { border: 1px solid #333; padding: 4px 5px; text-align: center; }
.print-table td.text-left { text-align: left; }
.print-total { margin-top: 8px; display: flex; justify-content: flex-end; gap: 26px; font-size: 13px; }
.print-sign { margin-top: 26px; display: flex; justify-content: space-between; font-size: 12px; }
@media print {
  .print-toolbar { display: none !important; }
  .print-page { width: auto; padding: 0; }
}

/* 首页看板 */
.dashboard { padding: 12px; }
.dash-card { background: #fff; border-radius: 3px; box-shadow: 0 1px 4px rgba(0,0,0,.08); margin-bottom: 12px; }
.dash-card .hd { padding: 10px 15px; border-bottom: 1px solid #f0f0f0; font-size: 15px; color: #40a7dc; display: flex; align-items: center; }
.dash-card .hd .badge { margin-left: auto; font-size: 12px; color: #fff; background: #acda55; padding: 2px 8px; border-radius: 10px; }
.dash-card .bd { padding: 14px 16px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-card { background: #fff; border-radius: 3px; box-shadow: 0 1px 4px rgba(0,0,0,.08); padding: 14px 18px; }
.stat-card .t { font-size: 14px; color: #666; display: flex; align-items: center; }
.stat-card .t .tag { margin-left: auto; font-size: 11px; color: #fff; border-radius: 10px; padding: 1px 7px; }
.stat-card .v { font-size: 27px; font-weight: bold; color: #333; margin-top: 8px; }
.stat-card .s { font-size: 12px; color: #999; margin-top: 2px; }
.quick-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.quick-item { background: #fff; border-radius: 3px; box-shadow: 0 1px 4px rgba(0,0,0,.08); text-align: center; padding: 18px 8px; cursor: pointer; }
.quick-item i { font-size: 34px; }
.quick-item div { margin-top: 8px; font-size: 14px; }
.steps { font-size: 13px; line-height: 2.3; color: #555; }
.steps a { margin-left: 10px; }
.faq-q { color: #f88f36; margin-top: 8px; }
.faq-a { color: #40a7dc; font-size: 13px; }

/* 商品选择弹层 */
.picker-search { display: flex; gap: 8px; margin-bottom: 8px; }
.picker-search input { flex: 1; }
.picker-tip { color: #999; font-size: 12px; margin-left: 8px; }
.badge-green { color: #63c963; }
.badge-red { color: #ff5722; }

/* ============ 细节校准 ============ */
.topnav > li > a { padding: 0 10px; font-size: 13px; }
.topbar .brand { max-width: 360px; font-size: 21px; }
.layui-form-label { width: 96px; }
.layui-input-block { margin-left: 96px; }
.total-panel .layui-form-label { width: 100px; }
.total-panel .layui-input-block { margin-left: 100px; }
.button-row { clear: both; width: 100%; padding-top: 6px; padding-right: 0; }
.layui-table-cell { height: 38px; line-height: 38px; }
.layui-table-header .layui-table-cell { height: 36px; line-height: 36px; }
.rail-logo .logo-cloud { font-size: 22px; color: #fff; line-height: 1; }
.quick-item:hover { box-shadow: 0 3px 12px rgba(0,0,0,.12); transform: translateY(-1px); transition: all .2s; }
#tabList .tab { user-select: none; }
.tab-context { border-radius: 3px; }

/* ============ 经典 / 新版皮肤 ============ */
.rail, .rail-item, .rail-item > a, .rail-logo .logo-circle, .rail-name,
.rail-foot, .rail-foot .skin span, .topbar .brand, .tabbar, .tabbar .tab, .workspace {
  transition: background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.rail-foot .skin span { padding: 2px 7px; font-size: 11px; }
.rail-foot .skin span:hover { background: rgba(255,255,255,.2); }
.rail-foot .skin span.on:hover { background: #fff; }

html.skin-new .rail {
  background: #fff;
  background-image: none;
  color: #303133;
  border-right: 1px solid #e7edf5;
  box-shadow: 2px 0 10px rgba(31, 45, 61, .05);
}
html.skin-new .rail-logo .logo-circle { background: #e8f3ff; }
html.skin-new .rail-logo .logo-cloud { color: #187ee7; }
html.skin-new .rail-name { color: #187ee7; font-weight: 600; }
html.skin-new .rail-item > a { color: #5b6675; }
html.skin-new .rail-item:hover { background: #f2f7ff; }
html.skin-new .rail-item:hover > a { color: #187ee7; }
html.skin-new .rail-foot { color: #98a2b3; }
html.skin-new .rail-foot .skin span { border-color: #ccd6e2; color: #64748b; }
html.skin-new .rail-foot .skin span:hover { background: #eef5ff; }
html.skin-new .rail-foot .skin span.on { background: #187ee7; border-color: #187ee7; color: #fff; }
html.skin-new .power { border-top-color: #187ee7; box-shadow: 3px 3px 14px rgba(31,45,61,.16); }
html.skin-new .topbar { box-shadow: 0 1px 0 #e7edf5; }
html.skin-new .topbar .brand { color: #187ee7; }
html.skin-new .workspace { background: #f5f7fa; }
html.skin-new .tabbar { background: #fbfcfe; border-bottom-color: #e7edf5; }
html.skin-new .tabbar .tab.active { background: #fff; color: #187ee7; box-shadow: inset 0 2px 0 #187ee7; }
html.skin-new .iframe-wrap { background: #f5f7fa; }


