* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif; background: #f4f7fb; color: #1f2937; }
a { color: inherit; text-decoration: none; }
body { min-height: 100vh; }
.admin-layout { min-height: 100vh; display: flex; }
.sidebar {
    width: 240px; padding: 24px 18px; color: #fff;
    background: linear-gradient(180deg, #111827 0%, #1f2937 100%);
    position: sticky; top: 0; align-self: flex-start; min-height: 100vh;
}
.logo-box { margin-bottom: 28px; padding: 18px; border-radius: 18px; background: rgba(255,255,255,0.08); }
.logo-title { font-size: 24px; font-weight: 700; }
.logo-sub { margin-top: 6px; font-size: 13px; color: rgba(255,255,255,0.75); }
.menu-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.menu-item a { display: block; padding: 14px 16px; border-radius: 14px; color: rgba(255,255,255,0.86); }
.menu-item.active a, .menu-item a:hover { background: linear-gradient(135deg, #3b82f6, #6366f1); color: #fff; }
.main-wrap { flex: 1; min-width: 0; padding: 24px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-title { font-size: 28px; font-weight: 700; color: #0f172a; }
.page-desc, .muted { color: #64748b; }
.admin-info { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 18px; padding: 12px 16px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08); }
.alert { padding: 14px 18px; border-radius: 16px; margin-bottom: 18px; }
.alert-success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.card, .panel-card, .content-card, .table-wrap, .form-card, .todo-card {
    background: #fff; border-radius: 22px; padding: 22px; box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
}
.stat-grid, .todo-grid, .panel-row { display: grid; gap: 18px; }
.stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.todo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel-row { grid-template-columns: 1fr 1fr; margin-top: 20px; }
.stat-card { background: linear-gradient(135deg, #fff, #f8fbff); border: 1px solid #e5edf7; border-radius: 20px; padding: 20px; }
.stat-label, .todo-label { font-size: 14px; color: #64748b; margin-bottom: 8px; }
.stat-value, .todo-value { font-size: 30px; font-weight: 700; color: #0f172a; }
.panel-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; color: #0f172a; }
.todo-card { margin-top: 20px; }
.todo-item { padding: 18px; border-radius: 18px; background: linear-gradient(135deg, #f8fafc, #eef2ff); border: 1px solid #e5e7eb; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 720px; }
.table th, .table td { padding: 12px 14px; border-bottom: 1px solid #edf2f7; text-align: left; font-size: 14px; }
.table th { background: #f8fafc; color: #334155; }
.table tr:hover td { background: #fafcff; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; }
.badge-success { background: #ecfdf5; color: #047857; }
.badge-warning { background: #fff7ed; color: #c2410c; }
.badge-danger { background: #fef2f2; color: #b91c1c; }
.badge-info { background: #eff6ff; color: #1d4ed8; }
.toolbar, .toolbar-between { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar-between { justify-content: space-between; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group.full { grid-column: 1 / -1; }
label { font-size: 14px; font-weight: 600; color: #334155; }
input[type="text"], input[type="password"], input[type="email"], input[type="number"], textarea, select {
    width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid #dbe4f0; background: #fff; outline: none; font-size: 14px;
}
input:focus, textarea:focus, select:focus { border-color: #5b7cff; box-shadow: 0 0 0 4px rgba(91,124,255,0.10); }
textarea { min-height: 110px; resize: vertical; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 12px; border: none; cursor: pointer; font-size: 14px; }
.btn-primary { background: linear-gradient(135deg, #3b82f6, #6366f1); color: #fff; }
.btn-default { background: #e5e7eb; color: #111827; }
.btn-success { background: #10b981; color: #fff; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-link { background: transparent; color: #2563eb; padding: 0; }
.btn + .btn { margin-left: 6px; }
.auth-body {
    min-height: 100vh; display: flex; align-items: stretch; justify-content: center; padding: 32px; gap: 28px;
    background: radial-gradient(circle at top left, rgba(88,138,255,0.28), transparent 28%),
                radial-gradient(circle at bottom right, rgba(0,210,255,0.22), transparent 24%),
                linear-gradient(135deg, #0f172a 0%, #101828 40%, #111827 100%);
}
.brand-panel, .auth-panel { width: 50%; min-height: calc(100vh - 64px); }
.brand-panel {
    color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 48px;
    border-radius: 28px; background: linear-gradient(160deg, rgba(255,255,255,0.10), rgba(255,255,255,0.03));
    border: 1px solid rgba(255,255,255,0.10); box-shadow: 0 20px 80px rgba(0,0,0,0.28);
}
.brand-badge { width: fit-content; padding: 8px 16px; border-radius: 999px; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.18); font-size: 14px; margin-bottom: 22px; }
.brand-panel h1 { margin: 0 0 16px; font-size: 44px; line-height: 1.2; }
.brand-panel p { color: rgba(255,255,255,0.82); line-height: 1.8; }
.feature-list { margin-top: 38px; display: grid; gap: 18px; }
.feature-item { padding: 20px 22px; border-radius: 20px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); }
.auth-panel { display: flex; align-items: center; justify-content: center; }
.glass-card { width: 100%; max-width: 560px; border-radius: 28px; padding: 28px; background: rgba(255,255,255,0.96); box-shadow: 0 24px 80px rgba(10,16,34,0.35); }
.tabs { display: flex; margin-bottom: 22px; background: #f3f6fb; border-radius: 18px; padding: 6px; }
.tab-item { flex: 1; text-align: center; padding: 14px 10px; border-radius: 14px; color: #64748b; font-weight: 600; }
.tab-item.active { background: linear-gradient(135deg, #3b82f6, #6366f1); color: #fff; }
.description-list { display: grid; gap: 10px; }
.description-row { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid #edf2f7; }
.description-row:last-child { border-bottom: none; }
.text-right { text-align: right; }
@media (max-width: 1200px) { .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .panel-row { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
    .admin-layout { flex-direction: column; }
    .sidebar { width: 100%; min-height: auto; position: static; }
    .topbar, .admin-info, .toolbar-between { flex-direction: column; align-items: stretch; }
    .main-wrap { padding: 16px; }
    .todo-grid, .stat-grid, .form-grid { grid-template-columns: 1fr; }
    .auth-body { padding: 16px; flex-direction: column; }
    .brand-panel, .auth-panel { width: 100%; min-height: auto; }
    .brand-panel { padding: 32px 26px; }
}

.menu-group-title { margin: 18px 0 8px; font-size: 12px; color: rgba(255,255,255,0.48); letter-spacing: 1px; padding-left: 6px; }
.quick-grid { display:grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap:18px; }
.quick-card { background:#fff; border-radius:18px; padding:18px; box-shadow:0 10px 24px rgba(15,23,42,.06); }
.empty-hint { color:#64748b; padding:12px 0; }
.inline-form { display:flex; gap:12px; flex-wrap:wrap; align-items:end; margin-bottom:16px; }
.inline-form .form-group { min-width: 180px; flex:1; }
.section-space { margin-top:20px; }
.code-box { padding:14px; border-radius:16px; background:#0f172a; color:#e2e8f0; font-size:13px; overflow:auto; }
.note-box { padding:14px 16px; border-radius:16px; background:#eff6ff; border:1px solid #bfdbfe; color:#1d4ed8; margin-bottom:18px; }
@media (max-width: 900px) { .quick-grid { grid-template-columns: 1fr; } }
/* 页面整体更紧凑 */
.main-wrap {
    min-height: 100vh;
}

.main-content,
.content-wrap,
.page-content {
    max-width: 1600px;
}

.page-toolbar.compact-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
}

.page-toolbar-title {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
}

.page-toolbar-desc {
    margin-top: 4px;
    color: #6b7280;
    font-size: 13px;
}

.segmented {
    display: inline-flex;
    background: #f3f4f6;
    border-radius: 10px;
    padding: 4px;
    gap: 4px;
}

.segmented-item {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 8px;
    color: #374151;
    text-decoration: none;
    font-size: 13px;
}

.segmented-item.active {
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    color: #111827;
    font-weight: 600;
}

/* 侧边栏手风琴：适配深色侧边栏 */
.sidebar-accordion {
    display: flex;
    flex-direction: column;
}

.sidebar-scroll {
    overflow-y: auto;
    padding-bottom: 12px;
}

.menu-group {
    margin-bottom: 8px;
}

.menu-group-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    color: rgba(255,255,255,0.92);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px;
    transition: all .2s ease;
}

.menu-group.open .menu-group-toggle,
.menu-group-toggle:hover {
    background: rgba(255,255,255,0.10);
    color: #ffffff;
}

.menu-group-arrow {
    color: rgba(255,255,255,0.70);
    font-size: 16px;
}

.sidebar-accordion .menu-list {
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
    display: block;
}

.sidebar-accordion .menu-item {
    margin: 4px 0;
}

.sidebar-accordion .menu-item a {
    display: block;
    padding: 10px 14px 10px 18px;
    border-radius: 10px;
    color: rgba(255,255,255,0.82);
    text-decoration: none;
    font-size: 13px;
    transition: all .2s ease;
}

.sidebar-accordion .menu-item.active a,
.sidebar-accordion .menu-item a:hover {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
    font-weight: 600;
}

/* Dashboard */
.compact-stat-grid {
    margin-bottom: 16px;
}

.dashboard-grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.chart-card {
    min-height: 320px;
    padding: 18px;
}

.chart-card canvas {
    width: 100% !important;
    height: 240px !important;
}

.panel-card,
.table-card,
.todo-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .06);
    padding: 18px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.panel-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.panel-extra,
.panel-link {
    color: #6b7280;
    font-size: 13px;
    text-decoration: none;
}

.compact-todo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.todo-item {
    border-radius: 14px;
    background: #f8fafc;
    padding: 16px;
}

.todo-label {
    font-size: 13px;
    color: #6b7280;
}

.todo-value {
    margin-top: 8px;
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

.table-compact {
    overflow: auto;
}

.table-compact .table th,
.table-compact .table td {
    white-space: nowrap;
    padding-top: 10px;
    padding-bottom: 10px;
}

/* 列表页：筛选区一行收纳 */
.filter-card,
.search-card,
.list-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
    margin-bottom: 16px;
    padding: 16px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .05);
}

.filter-card .form-item,
.search-card .form-item,
.list-filter .form-item {
    min-width: 180px;
    flex: 1 1 180px;
}

.filter-card .form-actions,
.search-card .form-actions,
.list-filter .form-actions {
    display: flex;
    gap: 10px;
    flex: 0 0 auto;
}

/* 列表页表格卡片化 */
.list-card,
.table-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .06);
    padding: 16px;
}

/* 响应式 */
@media (max-width: 1200px) {
    .dashboard-grid-two {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .page-toolbar.compact-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .compact-todo-grid {
        grid-template-columns: 1fr;
    }
}

.pagination-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.pagination-summary {
    font-size: 13px;
    color: #64748b;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.page-btn,
.page-num,
.page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 13px;
    background: #fff;
    border: 1px solid #dbe4f0;
    color: #334155;
}

.page-btn:hover,
.page-num:hover {
    border-color: #3b82f6;
    color: #2563eb;
}

.page-num.active {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    border-color: transparent;
    color: #fff;
}

.page-btn.disabled {
    background: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
}

.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal-dialog {
    width: 520px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
}

.modal-head,
.modal-foot {
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.modal-close {
    border: 0;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
}

.modal-body {
    padding: 0 18px 18px;
}

.product-thumb,
.product-thumb-empty {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    background: #f8fafc;
}

.table-actions-top {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.upload-box,
.sku-image-box {
    position: relative;
    width: 120px;
    height: 120px;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    background: #f8fafc;
    cursor: pointer;
    overflow: hidden;
}

.upload-box.dragover,
.sku-image-box.dragover,
.upload-gallery-trigger.dragover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.upload-file-input {
    display: none;
}

.upload-preview {
    width: 100%;
    height: 100%;
}

.upload-preview.small {
    width: 70px;
    height: 70px;
}

.upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: #94a3b8;
}

.upload-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.gallery-item {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid #e5e7eb;
    background: #fff;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-remove {
    position: absolute;
    right: 6px;
    top: 6px;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 50%;
    background: rgba(0,0,0,.55);
    color: #fff;
    cursor: pointer;
}

.upload-gallery-trigger {
    min-height: 100px;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    background: #f8fafc;
    cursor: pointer;
}

.toolbar-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.upload-loading {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
    font-size: 13px;
    background: #eff6ff;
}
.material-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.material-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .05);
}

.material-check {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    background: rgba(255,255,255,.92);
    border-radius: 8px;
    padding: 4px 6px;
}

.material-image {
    aspect-ratio: 1 / 1;
    background: #f8fafc;
    overflow: hidden;
}

.material-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.material-info {
    padding: 12px 14px 8px;
}

.material-name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    word-break: break-all;
}

.material-meta {
    margin-top: 6px;
    font-size: 12px;
    color: #64748b;
    word-break: break-all;
}

.material-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 14px 14px;
}

.gallery-item.uploading {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
}
.upload-gallery-trigger.dragover,
.upload-box.dragover,
.sku-image-box.dragover {
    border-color: #2563eb;
    background: #eff6ff;
}

/*物流信息样式*/
.logistics-timeline {
    position: relative;
    padding-left: 8px;
}

.logistics-item {
    position: relative;
    display: flex;
    gap: 14px;
    padding: 0 0 18px 0;
}

.logistics-item:last-child {
    padding-bottom: 0;
}

.logistics-item::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 18px;
    width: 1px;
    height: calc(100% - 6px);
    background: #dbe4f0;
}

.logistics-item:last-child::before {
    display: none;
}

.logistics-dot {
    position: relative;
    z-index: 1;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #cbd5e1;
    margin-top: 4px;
    flex: 0 0 13px;
}

.logistics-item.active .logistics-dot {
    background: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.logistics-content {
    flex: 1;
    min-width: 0;
    padding-bottom: 2px;
}

.logistics-status {
    font-size: 14px;
    line-height: 1.7;
    color: #334155;
}

.logistics-time {
    margin-top: 4px;
    font-size: 12px;
    color: #94a3b8;
}

.logistics-item.active .logistics-status {
    color: #111827;
    font-weight: 600;
}

.logistics-item.active .logistics-time {
    color: #2563eb;
}