* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    background: #f1f5f9;
    color: #334155;
    font-size: 14px;
}
a { text-decoration: none; color: inherit; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 220px;
    background: #1e293b;
    color: #cbd5e1;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
.sidebar .brand {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    background: #0f172a;
    letter-spacing: 2px;
}
.sidebar .nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.sidebar .nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 8px;
    margin-bottom: 4px;
    color: #cbd5e1;
    transition: all .2s;
}
.sidebar .nav a:hover { background: #334155; color: #fff; }
.sidebar .nav a.active { background: #2563eb; color: #fff; }
.sidebar .nav .icon { width: 18px; text-align: center; }
.sidebar .footer { padding: 14px; border-top: 1px solid #334155; font-size: 12px; color: #64748b; text-align: center; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    height: 60px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar .page-title { font-size: 16px; font-weight: 600; color: #0f172a; }
.topbar .user-box { display: flex; align-items: center; gap: 14px; }
.topbar .user-box .avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}
.topbar .user-box a.link { color: #64748b; }
.topbar .user-box a.link:hover { color: #2563eb; }

.content { padding: 24px; }

/* ---------- 卡片 ---------- */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    padding: 20px;
    margin-bottom: 20px;
}
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; color: #0f172a; }

/* ---------- 统计卡片 ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    display: flex;
    align-items: center;
    gap: 16px;
}
.stat-card .num { font-size: 28px; font-weight: 700; color: #0f172a; }
.stat-card .label { color: #64748b; font-size: 13px; margin-top: 2px; }
.stat-card .badge { width: 46px; height: 46px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 22px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
/* 分页控件 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.pagination .page-info { color: #64748b; font-size: 13px; margin-right: 8px; }
.pagination .page-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #64748b;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}
.pagination .page-btn:hover:not(:disabled) { border-color: #2563eb; color: #2563eb; }
.pagination .page-btn.active { background: #2563eb; border-color: #2563eb; color: #fff; }
.pagination .page-btn:disabled { opacity: .4; cursor: not-allowed; }
.pagination .page-size { padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 13px; color: #334155; background: #fff; outline: none; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
th { background: #f8fafc; color: #64748b; font-weight: 600; font-size: 13px; }
tr:hover td { background: #f8fafc; }
.empty { text-align: center; color: #94a3b8; padding: 40px 0 !important; }

/* ---------- 状态标签 ---------- */
.tag { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; }
.tag-0 { background: #fef3c7; color: #b45309; }
.tag-1 { background: #dcfce7; color: #15803d; }
.tag-2 { background: #fee2e2; color: #b91c1c; }
.tag-gray { background: #f1f5f9; color: #64748b; }
.tag-blue { background: #dbeafe; color: #1d4ed8; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all .2s;
}
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-outline { background: #fff; color: #64748b; border: 1px solid #cbd5e1; }
.btn-outline:hover { border-color: #2563eb; color: #2563eb; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-warn { background: #d97706; color: #fff; }
.btn-warn:hover { background: #b45309; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 表单 ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.input, .select, textarea.input {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color .2s;
    background: #fff;
    color: #334155;
}
.input:focus, .select:focus, textarea.input:focus { border-color: #2563eb; }
.input { width: 240px; }
.form-grid {grid-template-columns: 1fr 1fr;gap: 16px;}
.form-item { display: flex; flex-direction: column; gap: 6px; }
.form-item label { font-size: 13px; color: #64748b; }
.form-item .input, .form-item .select, .form-item textarea.input { width: 100%; }
.form-item.full { width: 100%; }

/* ---------- 弹窗 ---------- */
.modal-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.5);
    z-index: 100;
    align-items: center;
    justify-content: center;
}
.modal-mask.show { display: flex; }
.modal {
    background: #fff;
    border-radius: 12px;
    width: 520px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    padding: 24px;
    animation: pop .2s;
}
@keyframes pop { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-title { font-size: 16px; font-weight: 600; margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.screenshot-box { display: flex; align-items: center; min-height: 40px; }
.screenshot-img { max-width: 220px; max-height: 220px; border-radius: 8px; border: 1px solid #e2e8f0; object-fit: contain; }
.screenshot-empty { color: #94a3b8; font-size: 13px; }
.qrcode-thumb { width: 40px; height: 40px; object-fit: contain; border-radius: 6px; border: 1px solid #e2e8f0; cursor: pointer; }
.qrcode-thumb:hover { border-color: #2563eb; }
.qrcode-link { color: #2563eb; text-decoration: none; cursor: pointer; }
.qrcode-link:hover { text-decoration: underline; }
.tracking-link { color: #2563eb; text-decoration: none; cursor: pointer; }
.tracking-link:hover { text-decoration: underline; }

/* 快递公司列图标按钮 */
.company-cell { display: inline-flex; align-items: center; gap: 4px; }
.company-name {
    display: inline-block;
    max-width: 20ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
/* 商品列双行展示：名称 + 简介 */
.product-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 20ch;
}
.product-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.product-intro {
    font-size: 12px;
    color: #64748b;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
}
.col-company { max-width: 100px; width: 100px; }
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    border-radius: 4px;
    transition: all .2s;
}
.btn-icon:hover { color: #2563eb; background: #f1f5f9; }
.btn-icon:focus { outline: none; }

/* ---------- 提示 Toast ---------- */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    opacity: 0;
    transition: all .3s;
    pointer-events: none;
}
.toast.show { opacity: 1; top: 32px; }
.toast-success { background: #16a34a; }
.toast-error { background: #ef4444; }
.toast-info { background: #2563eb; }

/* ---------- 登录页 ---------- */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
}
.login-card {
    background: #fff;
    border-radius: 16px;
    width: 380px;
    padding: 40px 36px;
    box-shadow: 0 20px 40px rgba(0,0,0,.2);
}
.login-card h1 { font-size: 22px; text-align: center; margin-bottom: 6px; color: #0f172a; }
.login-card .sub { text-align: center; color: #94a3b8; font-size: 13px; margin-bottom: 28px; }
.login-card .form-item { margin-bottom: 16px; }
.login-card .btn { width: 100%; justify-content: center; padding: 11px; font-size: 15px; }
.login-error { background: #fef2f2; color: #b91c1c; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }

/* ---------- 复选框组(权限) ---------- */
.checkbox-group { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.checkbox-group label { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 8px; transition: all .15s; }
.checkbox-group label:hover { border-color: #2563eb; }
.checkbox-group input { accent-color: #2563eb; }

/* 欢迎页 */
.welcome-box { text-align: center; padding: 40px 0; }
.welcome-box h2 { font-size: 22px; margin-bottom: 10px; color: #0f172a; }
.welcome-box p { color: #64748b; margin-bottom: 8px; }

@media (max-width: 900px) {
    .sidebar { width: 64px; }
    .sidebar .brand { font-size: 14px; }
    .sidebar .nav a { justify-content: center; }
    .sidebar .nav .text { display: none; }
    .form-grid { width: 100%; }
}

/* 备案号 */
.icp-footer {
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
    padding: 16px 0 24px;
    background: #f1f5f9;
    display: block;
}

.icp-footer a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.icp-footer a:hover {
    text-decoration: underline;
}
