/* ============================================================
   浙里好物 - 管理后台样式
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; font-size: 13.5px; color: #2b2f36; background: #eef1f6; }
a { color: #1450a3; text-decoration: none; }
a:hover { color: #c7000b; }
code { background: #eef3fb; color: #1450a3; padding: 1px 6px; border-radius: 3px; font-size: 12px; font-family: Consolas, monospace; }

/* ---------- 布局 ---------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-side { width: 218px; background: #12305f; color: #b9c6de; flex-shrink: 0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-logo { display: flex; align-items: center; gap: 10px; padding: 18px 16px; color: #fff; font-size: 17px; font-weight: 700; letter-spacing: 2px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.admin-logo:hover { color: #fff; }
.admin-logo small { display: block; font-size: 11px; font-weight: 400; color: #8fa2c4; letter-spacing: 0; }
.logo-seal {
    width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0; background: #c7000b; color: #fff;
    font-size: 30px; line-height: 52px; text-align: center; font-family: "SimSun", serif; font-weight: 700;
    border: 2px solid #fff; outline: 2px solid #c7000b;
}
.logo-seal.seal-sm { width: 36px; height: 36px; line-height: 36px; font-size: 20px; outline-width: 1.5px; }
.admin-menu { padding: 10px 0; flex: 1; }
.menu-group-title { padding: 12px 18px 4px; font-size: 12px; color: #6f86ad; letter-spacing: 1px; }
.menu-item { display: block; padding: 9px 18px 9px 26px; color: #c6d2e8; font-size: 13.5px; border-left: 3px solid transparent; }
.menu-item:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.menu-item.on { color: #fff; background: rgba(255, 255, 255, .08); border-left-color: #c7000b; }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar { background: #fff; border-bottom: 1px solid #dde3ee; padding: 14px 24px; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 10; }
.admin-topbar h1 { font-size: 17px; color: #12305f; }
.admin-user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #4a5468; }
.admin-avatar { width: 30px; height: 30px; border-radius: 50%; background: #1450a3; color: #fff; line-height: 30px; text-align: center; font-size: 14px; }
.admin-user a { color: #8a93a5; }
.admin-user a:hover { color: #c7000b; }
.admin-content { padding: 22px 24px; flex: 1; }
.admin-footer { text-align: center; color: #a0a8b6; font-size: 12px; padding: 16px; border-top: 1px solid #dde3ee; }

/* ---------- 提示 ---------- */
.alert { padding: 11px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 13.5px; }
.alert-ok { background: #e9f7ef; color: #1a7f4b; border: 1px solid #bfe8d0; }
.alert-err { background: #fbeaea; color: #b3261e; border: 1px solid #f0c4c4; }

/* ---------- 统计卡片 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card { background: #fff; border: 1px solid #e2e6ef; border-radius: 8px; padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; transition: all .15s; }
.stat-card:hover { box-shadow: 0 4px 12px rgba(20, 40, 80, .1); transform: translateY(-2px); }
.stat-card.warn { border-left: 4px solid #c7000b; }
.stat-num { font-size: 26px; font-weight: 700; color: #12305f; }
.stat-card.warn .stat-num { color: #c7000b; }
.stat-label { font-size: 12.5px; color: #8a93a5; }

/* ---------- 面板 ---------- */
.panel { background: #fff; border: 1px solid #e2e6ef; border-radius: 8px; padding: 20px 22px; margin-bottom: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h3 { font-size: 15.5px; color: #12305f; border-left: 4px solid #c7000b; padding-left: 10px; }
.panel-sub { font-size: 14.5px; color: #12305f; margin: 20px 0 6px; border-bottom: 1px solid #eef1f6; padding-bottom: 8px; }
.panel-sub:first-child { margin-top: 0; }
.panel-actions { display: flex; gap: 8px; align-items: center; }
.panel-tip { font-size: 12.5px; color: #8a93a5; margin: 6px 0 12px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.form-grid { display: grid; gap: 0 16px; margin-bottom: 6px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.form-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.form-narrow { max-width: 520px; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; align-items: center; }

/* ---------- 表单 ---------- */
.a-label { display: block; font-size: 13px; color: #4a5468; margin: 12px 0 5px; }
.a-input {
    width: 100%; padding: 8px 11px; border: 1px solid #ccd5e3; border-radius: 5px; font-size: 13px;
    outline: none; background: #fff; font-family: inherit;
}
.a-input:focus { border-color: #1450a3; box-shadow: 0 0 0 3px rgba(20, 80, 163, .1); }
.a-input.mono { font-family: Consolas, "Courier New", monospace; font-size: 12.5px; line-height: 1.7; }
.a-input.w120 { max-width: 120px; }
.input-group { display: flex; gap: 6px; }
.input-group .a-input { flex: 1; }
.req { color: #c7000b; }
.a-check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #4a5468; margin-top: 12px; cursor: pointer; }
.a-btn {
    display: inline-block; padding: 7px 16px; background: #fff; border: 1px solid #ccd5e3; border-radius: 5px;
    font-size: 13px; color: #4a5468; cursor: pointer; transition: all .12s; line-height: 1.5;
}
.a-btn:hover { border-color: #1450a3; color: #1450a3; }
.a-btn.primary { background: #1450a3; border-color: #1450a3; color: #fff; }
.a-btn.primary:hover { background: #0f3f80; color: #fff; }
.link-danger { color: #b3261e !important; }
.link-danger:hover { color: #8f1210 !important; }
.img-preview { margin-top: 8px; }
.img-preview img { max-width: 160px; max-height: 110px; border: 1px solid #e2e6ef; border-radius: 4px; }

/* ---------- 表格 ---------- */
.a-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.a-table th { background: #eef3fb; color: #0e3a77; padding: 8px 10px; border: 1px solid #d8e0ec; text-align: left; white-space: nowrap; }
.a-table td { padding: 8px 10px; border: 1px solid #e2e6ef; vertical-align: top; }
.a-table tbody tr:hover td { background: #fafbfd; }
.td-empty { text-align: center; color: #a0a8b6; padding: 28px !important; }
.td-ellipsis { max-width: 260px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.td-actions { white-space: nowrap; }
.td-actions a { margin-right: 8px; font-size: 12.5px; }
.row-edit { background: #f7f9fc !important; }
.row-edit td { border-left: 3px solid #1450a3 !important; }
.row-detail { margin-bottom: 10px; }
.row-detail p { padding: 3px 0; font-size: 13px; color: #4a5468; }
.reply-orig { color: #8a93a5 !important; }
.hidden { display: none; }

/* ---------- 徽标 ---------- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 11px; font-size: 12px; white-space: nowrap; }
.badge.ok { background: #e9f7ef; color: #1a7f4b; }
.badge.warn { background: #fff4e2; color: #b26a00; }
.badge.info { background: #e8f0fc; color: #1450a3; }
.badge.bad { background: #fbeaea; color: #b3261e; }

/* ---------- 地区树 ---------- */
.tree { margin: 2px 0 2px 26px; list-style: none; }
.tree > .tree-node { margin: 2px 0; }
.tree-row { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 4px; }
.tree-row:hover { background: #f2f6fd; }
.tree-badge { width: 24px; height: 18px; line-height: 18px; text-align: center; border-radius: 3px; color: #fff; font-size: 11px; flex-shrink: 0; }
.tree-badge.l1 { background: #c7000b; }
.tree-badge.l2 { background: #1450a3; }
.tree-badge.l3 { background: #5b8fcf; }
.tree-name { font-weight: 700; color: #2b2f36; }
.tree-code { font-size: 11.5px; color: #a0a8b6; font-family: Consolas, monospace; }
.tree-actions { margin-left: auto; display: flex; gap: 10px; font-size: 12.5px; }

/* ---------- 双栏 ---------- */
.admin-cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
.admin-cols > .admin-col { min-width: 0; }

/* ---------- 溯源环节 ---------- */
.step-row { border: 1px dashed #d5dce9; border-radius: 6px; padding: 10px 12px; margin-bottom: 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; background: #fafbfd; }
.step-no { width: 28px; height: 28px; border-radius: 50%; background: #1450a3; color: #fff; line-height: 28px; text-align: center; font-size: 13px; flex-shrink: 0; }
.step-row .a-input { max-width: 220px; }
.step-row .a-input.step-content { width: 100%; max-width: 100%; }
.step-row .a-input.w120 { max-width: 130px; }

/* ---------- 分页（复用前台样式） ---------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.pagination a, .pagination .current {
    display: inline-block; min-width: 32px; padding: 5px 11px; border: 1px solid #d5dce9;
    border-radius: 4px; font-size: 12.5px; color: #4a5468; background: #fff; text-align: center;
}
.pagination a:hover { border-color: #1450a3; color: #1450a3; }
.pagination .current { background: #1450a3; border-color: #1450a3; color: #fff; }
.pagination .pageinfo { font-size: 12px; color: #8a93a5; margin-left: 8px; }
.empty-state { text-align: center; padding: 34px 20px; color: #8a93a5; }

/* ---------- 登录页 ---------- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #12305f, #1450a3); }
.login-wrap { width: 400px; max-width: 92vw; }
.login-card { background: #fff; border-radius: 10px; box-shadow: 0 10px 40px rgba(0, 0, 0, .28); padding: 34px 38px; }
.login-logo { text-align: center; margin-bottom: 22px; }
.login-logo .logo-seal { display: inline-block; }
.login-logo h1 { font-size: 22px; color: #12305f; letter-spacing: 4px; margin-top: 12px; }
.login-logo p { font-size: 12.5px; color: #8a93a5; margin-top: 4px; }
.login-field label { display: block; font-size: 13px; color: #4a5468; margin: 14px 0 5px; }
.login-field input {
    width: 100%; height: 40px; padding: 0 13px; border: 1px solid #ccd5e3; border-radius: 5px;
    font-size: 14px; outline: none;
}
.login-field input:focus { border-color: #1450a3; box-shadow: 0 0 0 3px rgba(20, 80, 163, .1); }
.login-btn {
    width: 100%; height: 42px; margin-top: 22px; background: #1450a3; color: #fff; border: none;
    border-radius: 5px; font-size: 15px; letter-spacing: 6px; cursor: pointer;
}
.login-btn:hover { background: #0f3f80; }
.login-back { display: block; text-align: center; margin-top: 16px; font-size: 12.5px; color: #8a93a5; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-cols { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .admin-side { width: 64px; }
    .admin-logo span:last-child, .menu-item { display: none; }
    .admin-logo { justify-content: center; padding: 14px 8px; }
    .admin-content { padding: 14px; }
    .form-grid.two, .form-grid.three { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
}
