/* 管家婆数据查询平台 样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    background: #f3f5f9;
    color: #333;
    font-size: 14px;
}
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* 顶栏 */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    background: #1d3557; color: #fff; padding: 0 20px; height: 54px;
    border-radius: 0 0 8px 8px;
}
.brand { font-size: 18px; font-weight: 700; letter-spacing: 1px; }
.brand span { font-size: 12px; font-weight: 400; opacity: .75; margin-left: 8px; }
.nav a {
    color: #cbd5e1; text-decoration: none; padding: 6px 14px;
    border-radius: 6px; margin-left: 4px; transition: all .15s;
}
.nav a:hover { color: #fff; background: rgba(255,255,255,.12); }
.nav a.on { color: #fff; background: #e63946; }
.userbar { display: flex; align-items: center; gap: 10px; }
.userbar .uname { font-size: 13px; color: #cbd5e1; }
.userbar .logout {
    color: #fff; text-decoration: none; font-size: 13px;
    border: 1px solid rgba(255,255,255,.4); border-radius: 6px; padding: 4px 10px;
}
.userbar .logout:hover { background: #e63946; border-color: #e63946; }

/* 主区 */
.main { padding: 20px 0 30px; }
.pagetitle { font-size: 20px; margin-bottom: 16px; color: #1d3557; }
.sec { font-size: 16px; color: #1d3557; margin: 22px 0 10px; border-left: 4px solid #e63946; padding-left: 10px; }
.sec .sec-more { float: right; font-size: 12px; font-weight: 400; color: #8a93a6; text-decoration: none; }

/* 标签抽屉 */
.tabs {
    display: flex; gap: 6px; margin: 0 0 18px;
    border-bottom: 2px solid #e4e9f1; padding-bottom: 0;
}
.tabs a {
    text-decoration: none; color: #56606b; font-size: 14px;
    padding: 9px 18px; border-radius: 8px 8px 0 0;
    border: 1px solid transparent; border-bottom: none;
    transition: all .15s;
}
.tabs a:hover { color: #1d3557; background: #eef2f8; }
.tabs a.on { color: #e63946; font-weight: 600; background: #fff; border-color: #e4e9f1; }
.tabs a.on::after { content: ''; display: block; height: 2px; background: #e63946; margin: 0 -18px -11px; }

/* 统计卡片 */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.card {
    background: #fff; border-radius: 10px; padding: 16px; text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.card .num { font-size: 22px; font-weight: 700; color: #1d3557; margin-bottom: 6px; }
.card .lbl { font-size: 12px; color: #888; }

/* 筛选表单 */
.filter {
    background: #fff; border-radius: 10px; padding: 14px 16px;
    display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px;
    margin-bottom: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.filter label { font-size: 13px; color: #666; display: inline-flex; align-items: center; gap: 6px; }
.filter input[type=text], .filter input[type=date], .filter select {
    padding: 7px 10px; border: 1px solid #d5dbe5; border-radius: 6px; font-size: 13px; background: #fff;
}
.filter label.chk { color: #333; }
.filter .chkline { flex-basis: 100%; display: inline-flex; align-items: center; gap: 18px; }
.filter-sum { background: #f0f6ff; border: 1px solid #d0e3ff; border-radius: 8px; padding: 9px 14px; margin-bottom: 14px; font-size: 13px; color: #333; text-align: right; font-weight: 600; }
.filter-sum b { color: #0a53be; font-size: 15px; }

/* 按钮 */
.btn {
    display: inline-block; padding: 7px 16px; background: #e63946; color: #fff;
    border: none; border-radius: 6px; font-size: 13px; cursor: pointer; text-decoration: none;
}
.btn:hover { opacity: .9; }
.btn.ghost { background: #fff; color: #e63946; border: 1px solid #e63946; }

/* 表格 */
.grid {
    width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.grid th, .grid td { padding: 9px 12px; border-bottom: 1px solid #eef1f6; text-align: left; vertical-align: middle; }
.grid .srt { color: inherit; text-decoration: none; }
.grid .srt:hover { color: #1d3557; }
.grid thead th { background: #f8fafc; color: #475569; font-weight: 600; font-size: 13px; white-space: nowrap; }
.grid tbody tr:hover { background: #f8fafc; }
.grid tfoot th { background: #f8fafc; color: #1d3557; }
.empty { text-align: center; color: #999; padding: 20px; }
.grid .empty { text-align: center; color: #999; padding: 28px; }
.grid .sum { color: #666; font-size: 13px; }
.grid .muted { color: #999; font-size: 12px; }
.hint { margin: 16px 2px 4px; color: #999; font-size: 12px; line-height: 1.8; background: #fff; padding: 10px 12px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
tr.red td { color: #e63946; }
tr.red td .muted, tr.red td.sum { color: #e63946; }
tr.red td a, tr.red td a.dcode { color: #e63946; }
tr.purple td { color: #8e44ad; }
tr.purple td .muted, tr.purple td.sum { color: #8e44ad; }
tr.purple td a, tr.purple td a.dcode { color: #8e44ad; }
.red-amt { color: #e63946; font-weight: 700; }
.red-amt.purple { color: #8e44ad; }

/* 详情键值表 */
.box { background: #fff; border-radius: 10px; padding: 6px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.kv { width: 100%; border-collapse: collapse; }
.kv th { text-align: left; font-weight: 400; color: #888; width: 90px; padding: 9px 6px; font-size: 13px; }
.kv td { padding: 9px 6px; }
.kv tr { border-bottom: 1px dashed #eef1f6; }

/* 标签 */
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.tag.ok { background: #e6f7ed; color: #1a7f4b; }
.tag.warn { background: #fdeaea; color: #c0392b; }
.tag.violet { background: #f3eefb; color: #8e44ad; }
.tag.gray { background: #eef1f4; color: #5a6b7b; }
.tag.blue { background: #e8f0fe; color: #1a56db; }

/* AJAX 加载中（保留原内容，仅半透明提示，保持页面高度稳定） */
.gp-loading { opacity: .55; pointer-events: none; }

/* 分页 */
.pager { margin: 16px 0; text-align: right; color: #666; font-size: 13px; }
.pager a, .pager .cur {
    display: inline-block; min-width: 30px; padding: 5px 9px; margin: 0 2px;
    border: 1px solid #d5dbe5; border-radius: 6px; text-decoration: none; color: #333; text-align: center;
}
.pager a:hover { border-color: #e63946; color: #e63946; }
.pager .cur { background: #e63946; border-color: #e63946; color: #fff; font-weight: 600; }
.pager .dots { border: none; }

/* 工具条 */
.toolbar { margin-bottom: 14px; }

.foot {
    text-align: center; color: #a0aec0; font-size: 12px; padding: 20px 0 30px;
}

/* 登录页 */
.login-body {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; background: linear-gradient(135deg, #1d3557, #457b9d);
    padding: 24px 0;
}
.login-wrap { display: flex; flex-direction: column; align-items: center; }
.login-box {
    width: 340px; background: #fff; border-radius: 12px; padding: 36px 32px;
    box-shadow: 0 12px 32px rgba(0,0,0,.25);
}
.login-brand { font-size: 20px; font-weight: 700; color: #1d3557; text-align: center; margin-bottom: 24px; }
.login-brand span { font-size: 13px; font-weight: 400; color: #888; margin-left: 6px; }
.login-label { display: block; font-size: 13px; color: #666; margin: 14px 0 6px; }
.login-input {
    width: 100%; padding: 10px 12px; border: 1px solid #d5dbe5; border-radius: 8px;
    font-size: 14px; box-sizing: border-box;
}
.login-input:focus { outline: none; border-color: #e63946; }
.login-btn {
    width: 100%; margin-top: 22px; padding: 11px; background: #e63946; color: #fff;
    border: none; border-radius: 8px; font-size: 15px; letter-spacing: 4px; cursor: pointer;
}
.login-btn:hover { opacity: .9; }
.login-remember {
    display: flex; align-items: center; gap: 6px; margin-top: 12px;
    color: #555; font-size: 13px; cursor: pointer; user-select: none;
}
.login-remember input { width: 15px; height: 15px; accent-color: #e63946; cursor: pointer; }
.login-err {
    margin-top: 14px; padding: 8px 10px; background: #fdeaea; color: #c0392b;
    border-radius: 6px; font-size: 13px;
}
.login-tip { text-align: center; color: #aaa; font-size: 12px; margin-top: 16px; }
.login-icp { text-align: center; margin-top: 20px; font-size: 12px; }
.login-icp a { color: rgba(255,255,255,.65); text-decoration: none; }
.login-icp a:hover { color: #fff; }

/* 商品树页面布局 */
.pbody { display: flex; gap: 16px; align-items: flex-start; }
.ptree {
    width: 260px; flex-shrink: 0; background: #fff; border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 12px 10px;
    position: sticky; top: 12px; max-height: none;
}
.ptree-title { font-size: 13px; font-weight: 700; color: #1d3557; padding: 4px 8px 10px; border-bottom: 1px solid #eef1f6; margin-bottom: 8px; }
.ptree ul { list-style: none; margin: 0; padding: 0 0 0 14px; }
.ptree > ul { padding: 0; }
.ptree li { line-height: 1.9; font-size: 13px; }
.ptree li.cur > details > summary > a, .ptree li.cur > a { color: #e63946; font-weight: 700; }
.ptree details > summary {
    cursor: pointer; list-style: none; display: flex; align-items: center; gap: 4px;
}
.ptree details > summary::-webkit-details-marker { display: none; }
.ptree details > summary::before { content: "▸"; color: #b0b8c4; font-size: 11px; transition: transform .15s; }
.ptree details[open] > summary::before { content: "▾"; }
.ptree a { color: #333; text-decoration: none; }
.ptree a:hover { color: #e63946; }
.ptree .cnt { color: #b0b8c4; font-size: 11px; }

.pcontent { flex: 1; min-width: 0; }

/* 面包屑 */
.crumb { font-size: 14px; margin: 4px 0 12px; color: #666; }
.crumb a { color: #1d3557; text-decoration: none; }
.crumb a:hover { color: #e63946; }
.crumb .sep { color: #c0c6d0; margin: 0 6px; }

/* 分类卡片 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fff; border: 1px solid #dde3ec; border-radius: 8px;
    padding: 8px 12px; font-size: 13px; color: #333; text-decoration: none;
    box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.chip:hover { border-color: #e63946; color: #e63946; }
.chip span {
    background: #e63946; color: #fff; font-size: 11px; border-radius: 9px;
    padding: 1px 7px; min-width: 20px; text-align: center;
}

@media (max-width: 900px) {
    .pbody { flex-direction: column; }
    .ptree { width: 100%; position: static; max-height: 320px; }
}

/* 商品编号链接 */
.pcode, .ccode { color: #1d3557; font-weight: 600; text-decoration: none; border-bottom: 1px dashed #1d3557; cursor: pointer; }
.pcode:hover, .ccode:hover { color: #e63946; }
.dcode { color: #1d3557; font-weight: 600; text-decoration: none; border-bottom: 1px dashed #1d3557; }
.dcode:hover { color: #e63946; }

/* 商品详情弹窗 */
.modal-mask {
    position: fixed; inset: 0; background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center; z-index: 999;
}
.modal {
    background: #fff; border-radius: 10px; width: 720px; max-width: 94vw;
    max-height: 88vh; display: flex; flex-direction: column; overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,.3);
    resize: both; position: relative;
}
.modal-lg { width: 1080px; }
.modal::after {
    content: "";
    position: absolute; right: 4px; bottom: 4px;
    width: 12px; height: 12px;
    border-right: 2px solid rgba(29,53,87,.35);
    border-bottom: 2px solid rgba(29,53,87,.35);
    border-bottom-right-radius: 3px;
    pointer-events: none; z-index: 5;
}
.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 18px; font-weight: 700; background: #1d3557; color: #fff;
}
.modal-close { cursor: pointer; font-size: 22px; line-height: 1; padding: 0 4px; color: #cbd5e1; }
.modal-close:hover { color: #fff; }
.modal-body { padding: 18px; overflow: auto; }
.modal-body h3 { margin: 0 0 8px; font-size: 16px; }
.pd-path { font-size: 12px; color: #888; margin-bottom: 12px; }
.pd-path a { color: #457b9d; text-decoration: none; }
.pd-sec { margin: 14px 0 6px; font-weight: 700; color: #1d3557; border-left: 3px solid #e63946; padding-left: 8px; }
.pd-sec .pd-more { float: right; font-size: 12px; font-weight: 400; color: #8a93a6; text-decoration: none; }
.pd-basic { width: 100%; border-collapse: collapse; font-size: 13px; }
.pd-basic th, .pd-basic td { border: 1px solid #e5e7eb; padding: 6px 10px; text-align: left; }
.pd-basic th { background: #f8fafc; width: 90px; white-space: nowrap; color: #555; }
.pd-unit { border-collapse: collapse; font-size: 13px; }
.pd-unit th, .pd-unit td { border: 1px solid #e5e7eb; padding: 5px 12px; }
.pd-unit th { background: #f8fafc; }
.pd-price { border-collapse: collapse; font-size: 13px; }
.pd-price th, .pd-price td { border: 1px solid #e5e7eb; padding: 5px 12px; text-align: left; }
.pd-price th { background: #f8fafc; min-width: 130px; font-weight: 600; color: #555; }
.modal-body .grid th { font-size: 12px; }
.feed-form { background: #fff; border: 1px solid #eef1f6; border-radius: 10px; padding: 20px; max-width: 720px; }
.feed-form .frow { display: flex; gap: 14px; margin-bottom: 14px; }
.feed-form .frow label { flex: 1; display: block; font-size: 13px; color: #666; margin-bottom: 4px; }
.feed-form input[type=text], .feed-form input[type=password], .feed-form textarea {
    width: 100%; padding: 9px 11px; font-size: 14px; border: 1px solid #dfe3ec; border-radius: 8px;
    background: #f7f9fc; outline: none; color: #1d3557; box-sizing: border-box;
}
.feed-form input[type=text]:focus, .feed-form input[type=password]:focus, .feed-form textarea:focus { border-color: #1d3557; background: #fff; }
.feed-form textarea { min-height: 64px; resize: vertical; }
.feed-form .fbtns { display: flex; gap: 10px; margin-top: 8px; }
.feed-form .msg-err { color: #c0392b; font-size: 13px; background: #fff5f5; border: 1px solid #f5c6cb; border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; }
.feed-form .msg-ok { color: #14532d; font-size: 13px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; }
