/* ============================================================
   铸配 · 界面主题（覆盖 Bootstrap 5 默认观感）
   设计基调：深钢蓝导航 + 熔橙点缀，浅灰蓝工作区背景
   ============================================================ */
:root {
    --zp-primary: #2b59c3;
    --zp-primary-dark: #1f4396;
    --zp-accent: #f0731d;
    --zp-bg: #edf1f7;
    --zp-ink: #1f2b3d;
    --zp-muted: #6b7a90;
    --zp-card-border: rgba(31, 43, 61, 0.07);
    --zp-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
    --zp-shadow-md: 0 4px 14px -2px rgba(16, 24, 40, 0.08), 0 2px 4px -1px rgba(16, 24, 40, 0.04);
    --zp-shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, 0.16);
    --zp-radius: 14px;
}

html { font-size: 15px; }

body {
    background-color: var(--zp-bg);
    background-image:
        radial-gradient(1200px 500px at 80% -10%, rgba(43, 89, 195, 0.08), transparent 60%),
        radial-gradient(900px 420px at -10% 0%, rgba(240, 115, 29, 0.06), transparent 55%);
    background-attachment: fixed;
    color: var(--zp-ink);
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", "Segoe UI", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main.container-fluid, main.container-xxl { flex: 1 0 auto; animation: zpFadeUp .35s ease both; }

@keyframes zpFadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 顶部导航 ---------- */
.zp-navbar {
    background: linear-gradient(120deg, #17263f 0%, #20395f 60%, #1c3153 100%);
    box-shadow: 0 2px 12px rgba(10, 18, 32, 0.35);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.zp-navbar .navbar-brand {
    font-weight: 700;
    letter-spacing: 0.5px;
    font-size: 1.2rem;
}
.zp-navbar .navbar-brand i { color: var(--zp-accent); text-shadow: 0 0 14px rgba(240, 115, 29, 0.55); }
.zp-navbar .nav-link {
    color: rgba(255, 255, 255, 0.78);
    border-radius: 8px;
    padding: 0.45rem 0.9rem !important;
    margin: 0 2px;
    transition: background .2s ease, color .2s ease;
}
.zp-navbar .nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.zp-navbar .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    font-weight: 600;
}
.zp-navbar .navbar-text { color: rgba(255, 255, 255, 0.65); }
.zp-navbar .navbar-text i { color: var(--zp-accent); }

/* ---------- 卡片 ---------- */
.card {
    border: 1px solid var(--zp-card-border);
    border-radius: var(--zp-radius);
    box-shadow: var(--zp-shadow-sm);
    transition: box-shadow .25s ease, transform .2s ease;
}
.card:hover { box-shadow: var(--zp-shadow-md); }
.card-header {
    background: linear-gradient(180deg, #fbfcfe, #f6f8fb);
    border-bottom: 1px solid var(--zp-card-border);
    font-weight: 600;
    color: var(--zp-ink);
    padding: 0.7rem 1rem;
    border-radius: var(--zp-radius) var(--zp-radius) 0 0 !important;
}
.card-header i { color: var(--zp-primary); margin-right: 4px; }
.card-footer { background: #fafbfc; border-top: 1px solid var(--zp-card-border); border-radius: 0 0 var(--zp-radius) var(--zp-radius) !important; }

/* ---------- 表格 ---------- */
.table { margin-bottom: 0; }
.table td, .table th { vertical-align: middle; padding: 0.5rem 0.75rem; }
.table thead th {
    background: #f1f5fa;
    color: var(--zp-muted);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    border-bottom-width: 1px;
    white-space: nowrap;
}
.table tbody tr { transition: background .15s ease; }
.table-hover tbody tr:hover { background: rgba(43, 89, 195, 0.045); }
.table input[type="number"] { text-align: right; }
.table tfoot th { background: #f8fafc; border-top: 2px solid #e3e9f1; }

/* ---------- 按钮 ---------- */
.btn { border-radius: 9px; font-weight: 500; transition: transform .12s ease, box-shadow .2s ease, background .2s ease; }
.btn:not(:disabled):hover { transform: translateY(-1px); }
.btn:not(:disabled):active { transform: translateY(0) scale(0.98); }
.btn-primary {
    background: linear-gradient(180deg, #3467d6, var(--zp-primary));
    border-color: var(--zp-primary);
    box-shadow: 0 2px 6px rgba(43, 89, 195, 0.35);
}
.btn-primary:hover, .btn-primary:focus { background: linear-gradient(180deg, #2f5ec8, var(--zp-primary-dark)); border-color: var(--zp-primary-dark); }
.btn-success {
    background: linear-gradient(180deg, #1aa653, #15803d);
    border-color: #15803d;
    box-shadow: 0 2px 6px rgba(21, 128, 61, 0.3);
}
.btn-outline-primary { color: var(--zp-primary); border-color: var(--zp-primary); }
.btn-outline-primary:hover { background: var(--zp-primary); border-color: var(--zp-primary); }
.btn:disabled { opacity: 0.65; cursor: not-allowed; }
.btn-sm { border-radius: 7px; }

/* ---------- 表单 ---------- */
.form-control, .form-select { border-radius: 8px; border-color: #d5dde8; }
.form-control:focus, .form-select:focus {
    border-color: var(--zp-primary);
    box-shadow: 0 0 0 0.2rem rgba(43, 89, 195, 0.14);
}
.form-label { font-weight: 500; color: #3d4c63; }
.input-group-text { background: #f1f5fa; border-color: #d5dde8; color: var(--zp-muted); border-radius: 8px; }

/* ---------- 徽章 / 状态 ---------- */
.badge { border-radius: 999px; padding: 0.4em 0.75em; font-weight: 600; letter-spacing: 0.3px; }
.badge.bg-success { background: #16a34a !important; }
.badge.bg-info { background: #0284c7 !important; }
.badge.bg-danger { background: #dc2626 !important; }
.badge.bg-secondary { background: #8a99ad !important; }

/* ---------- 提示条 ---------- */
.alert { border-radius: 10px; border: none; box-shadow: var(--zp-shadow-sm); }
.alert-info { background: #e8f1fd; color: #1f4396; border-left: 4px solid var(--zp-primary); }

/* ---------- 页头（材料库 / 配方等列表页） ---------- */
main h4 { font-weight: 700; color: var(--zp-ink); letter-spacing: 0.3px; }
main h4 i { color: var(--zp-primary); margin-right: 6px; }

/* ---------- 登录 / 注册 ---------- */
.auth-wrap { max-width: 420px; margin: 4vh auto 0; }
.auth-brand { text-align: center; margin-bottom: 1.2rem; }
.auth-brand .auth-logo {
    width: 64px; height: 64px; margin: 0 auto 10px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 18px;
    background: linear-gradient(140deg, #20395f, #17263f);
    box-shadow: var(--zp-shadow-lg), inset 0 1px 0 rgba(255,255,255,0.12);
}
.auth-brand .auth-logo i { font-size: 1.7rem; color: var(--zp-accent); text-shadow: 0 0 16px rgba(240,115,29,0.6); }
.auth-brand h4 { font-weight: 700; letter-spacing: 1px; }
.auth-brand p { color: var(--zp-muted); font-size: 0.85rem; margin-top: 2px; }
.auth-card { border: none; box-shadow: var(--zp-shadow-lg); }
.auth-card .card-header {
    background: transparent; border-bottom: none; text-align: center;
    font-size: 1.05rem; padding-top: 1.2rem;
}
.auth-card .card-body { padding: 0.6rem 1.6rem 1.6rem; }

/* ---------- 材料选择列表滚动条 ---------- */
.material-list::-webkit-scrollbar { width: 6px; }
.material-list::-webkit-scrollbar-thumb { background: #c3cedd; border-radius: 3px; }
.material-list::-webkit-scrollbar-thumb:hover { background: #9fb0c6; }
.material-list .form-check:hover { background: rgba(43, 89, 195, 0.04); }

/* ---------- 页脚 ---------- */
footer {
    flex-shrink: 0;
    border-top: 1px solid var(--zp-card-border);
    margin-top: 1.5rem;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(4px);
}
footer a { text-decoration: none; }
footer a:hover { color: var(--zp-primary) !important; }

/* ---------- 后台侧栏 ---------- */
.sidebar .nav-link { border-radius: 8px; margin: 2px 8px; transition: background .2s ease; }
.sidebar .nav-link:hover { background: rgba(255, 255, 255, 0.12); }
.sidebar .nav-link i { width: 18px; text-align: center; margin-right: 4px; opacity: 0.85; }

/* ---------- 移动端适配 ---------- */
@media (max-width: 767.98px) {
    html { font-size: 14px; }
    main.container-fluid { padding-left: 0.75rem; padding-right: 0.75rem; }
    .card-body.p-0 { overflow-x: auto; } /* 小屏表格横向滑动 */
    .card-body.p-0 .table { min-width: 420px; }
    main h4 { font-size: 1.1rem; }
    .zp-navbar .navbar-nav { padding: 0.4rem 0; }
    .zp-navbar .nav-link { padding: 0.55rem 0.9rem !important; }
    .auth-wrap { margin-top: 2vh; }
    .btn { font-size: 0.92rem; }
}

/* ---------- 打印（分享页） ---------- */
@media print {
    .zp-navbar, footer, .btn { display: none !important; }
    body { background: #fff; }
    .card { box-shadow: none; border-color: #ccc; }
}
