:root {
            --bg: #eef3ff;
            --bg-deep: #e6eeff;
            --card: #ffffff;
            --text: #1f2937;
            --muted: #6b7280;
            --border: #e5e7eb;
            --primary: #2563eb;
            --primary-hover: #1e4fd6;
            --primary-soft: #e7efff;
            --danger: #dc2626;
            --secondary: #4b5563;
            --shadow: 0 18px 45px rgba(15, 23, 42, 0.1);
            /* 图片媒体区：深色底只在加载/缺图时露出，正常被 cover 铺满 */
            --img-frame: #0f172a;
            --img-frame-soft: #1e293b;
        }

        * {
            box-sizing: border-box;
        }

        body {
            margin: 0;
            padding: 28px 16px;
            font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
            background: radial-gradient(circle at top right, #f3f7ff 0%, var(--bg) 42%, var(--bg-deep) 100%);
            color: var(--text);
            position: relative;
        }

        body::before,
        body::after {
            content: "";
            position: fixed;
            width: 320px;
            height: 320px;
            border-radius: 999px;
            filter: blur(55px);
            z-index: -1;
            opacity: 0.25;
        }

        body::before {
            background: #93c5fd;
            top: -120px;
            right: -60px;
        }

        body::after {
            background: #c4b5fd;
            bottom: -120px;
            left: -70px;
        }

        .container {
            max-width: 1240px;
            margin: 0 auto;
            background: rgba(255, 255, 255, 0.9);
            padding: 26px;
            border: 1px solid var(--border);
            border-radius: 16px;
            box-shadow: var(--shadow);
            backdrop-filter: blur(8px);
        }

        .nav {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 12px;
            margin-bottom: 18px;
            padding-bottom: 16px;
            border-bottom: 1px solid var(--border);
        }

        .title-wrap h1 {
            margin: 0;
            font-size: 24px;
            letter-spacing: 0.4px;
        }

        .subtitle {
            margin-top: 6px;
            color: var(--muted);
            font-size: 14px;
        }

        .top-actions {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }

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

        .badge {
            display: inline-flex;
            align-items: center;
            padding: 6px 10px;
            border-radius: 999px;
            border: 1px solid #dbeafe;
            background: linear-gradient(135deg, #eff6ff, #eef2ff);
            color: #1d4ed8;
            font-size: 12px;
            font-weight: 600;
        }

        .badge.admin {
            border-color: #fcd34d;
            background: linear-gradient(135deg, #fffbeb, #fef3c7);
            color: #92400e;
        }

        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 9px 14px;
            text-decoration: none;
            background: linear-gradient(135deg, #2563eb, #1d4ed8);
            color: #fff;
            border-radius: 8px;
            border: none;
            cursor: pointer;
            font-size: 14px;
            font-weight: 600;
            transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
            box-shadow: 0 7px 14px rgba(37, 99, 235, 0.2);
        }

        .btn:hover {
            background: var(--primary-hover);
            transform: translateY(-1px);
            box-shadow: 0 10px 18px rgba(37, 99, 235, 0.24);
        }

        .btn.danger {
            background: var(--danger);
            box-shadow: 0 7px 14px rgba(220, 38, 38, 0.2);
        }

        .btn.secondary {
            background: var(--secondary);
            box-shadow: 0 7px 14px rgba(75, 85, 99, 0.18);
        }

        .btn.light {
            background: var(--primary-soft);
            color: #1e3a8a;
            border: 1px solid #c7d2fe;
            box-shadow: none;
        }

        .btn-block {
            width: 100%;
        }

        .panel {
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 18px;
            margin-top: 14px;
            background: linear-gradient(180deg, #ffffff, #fcfdff);
            box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(3, minmax(180px, 1fr));
            gap: 12px;
            margin-top: 12px;
        }

        .stat-card {
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 14px;
            background: linear-gradient(140deg, #f8fbff, #ffffff 52%, #f8faff);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
        }

        .stat-title {
            margin: 0;
            font-size: 13px;
            color: var(--muted);
        }

        .stat-value {
            margin: 6px 0 0;
            font-size: 26px;
            font-weight: 700;
            color: #0f172a;
        }

        .panel-title {
            margin: 0 0 14px;
            font-size: 18px;
        }

        .table-wrap {
            width: 100%;
            overflow: auto;
            border: 1px solid var(--border);
            border-radius: 10px;
            background: #fff;
        }

        table {
            width: 100%;
            min-width: 1080px;
            border-collapse: collapse;
        }

        th, td {
            border-bottom: 1px solid var(--border);
            padding: 10px;
            vertical-align: top;
            font-size: 14px;
        }

        th {
            background: #f7faff;
            text-align: left;
            white-space: nowrap;
            position: sticky;
            top: 0;
            z-index: 1;
            font-weight: 700;
        }

        tr:last-child td {
            border-bottom: none;
        }

        tbody tr:hover {
            background: #f4f8ff;
        }

        tbody tr:nth-child(even):not(#no-match-row):not(#empty-row) {
            background: #fcfdff;
        }

        .flash {
            padding: 12px;
            border-radius: 8px;
            margin-bottom: 12px;
            font-size: 14px;
        }

        .flash.success {
            background: #e8f5e9;
            color: #2e7d32;
            border: 1px solid #c8e6c9;
        }

        .flash.error {
            background: #ffebee;
            color: #c62828;
            border: 1px solid #ffcdd2;
        }

        .form-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(240px, 1fr));
            gap: 12px;
        }

        .form-row {
            margin-bottom: 10px;
        }

        .span-2 {
            grid-column: span 2;
        }

        label {
            display: block;
            margin-bottom: 6px;
            font-size: 13px;
            color: #374151;
            font-weight: 600;
        }

        input, textarea, select {
            width: 100%;
            padding: 10px 11px;
            border: 1px solid #d1d5db;
            border-radius: 8px;
            font-size: 14px;
            background: #fff;
            transition: border-color 0.2s ease, box-shadow 0.2s ease;
        }

        input:focus, textarea:focus, select:focus {
            border-color: #93c5fd;
            outline: 2px solid #dbeafe;
            outline-offset: 0;
        }

        textarea {
            min-height: 96px;
            resize: vertical;
        }

        /* —— 产品图：统一 3:4 竖图容器（宽驱动高，cover 铺满） —— */
        .media-frame,
        .thumb-frame,
        .product-card-media,
        .product-detail-media,
        .product-swiper,
        .image-preview-frame {
            position: relative;
            overflow: hidden;
            background: var(--img-frame);
            border: none;
            box-shadow: none;
            padding: 0;
            aspect-ratio: 3 / 4;
        }

        .thumb-frame {
            display: inline-block;
            width: 60px;
            height: auto;
            border-radius: 8px;
            vertical-align: middle;
            flex-shrink: 0;
        }

        .thumb,
        .product-cover,
        .product-detail-image,
        .image-preview {
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: center center;
            background: transparent;
            border: none;
            border-radius: 0;
            box-shadow: none;
            display: block;
            padding: 0;
            margin: 0;
        }

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

        .inline-form {
            display: inline;
        }

        .muted {
            color: var(--muted);
            font-size: 13px;
        }

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

        .toolbar .left,
        .toolbar .right {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }

        .search-input {
            min-width: 260px;
        }

        .manage-search-box {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 10px;
            margin: 0 0 8px;
            padding: 12px 14px;
            border: 1px solid var(--border);
            border-radius: 10px;
            background: linear-gradient(180deg, #fafcff, #f4f8ff);
        }

        .manage-search-label {
            font-weight: 600;
            color: var(--text);
            white-space: nowrap;
        }

        .manage-search-input {
            flex: 1 1 280px;
            min-width: 220px;
            min-height: 40px;
            padding: 8px 12px;
            border: 1px solid var(--border);
            border-radius: 8px;
            font-size: 15px;
            background: #fff;
        }

        .manage-search-input:focus {
            outline: 2px solid rgba(37, 99, 235, 0.25);
            border-color: #2563eb;
        }

        .manage-search-hint {
            margin: 0 0 14px;
            font-size: 13px;
            line-height: 1.5;
        }

        .search-token {
            display: inline-block;
            margin: 0 4px 2px 0;
            padding: 1px 8px;
            border-radius: 999px;
            background: #e8efff;
            color: #1e3a8a;
            font-size: 12px;
        }

        .query-box {
            border: 1px solid var(--border);
            border-radius: 10px;
            background: linear-gradient(180deg, #fafcff, #f6f9ff);
            padding: 12px;
            margin-bottom: 12px;
        }

        .query-grid {
            display: grid;
            grid-template-columns: repeat(3, minmax(180px, 1fr));
            gap: 10px;
        }

        .query-actions {
            display: flex;
            gap: 8px;
            align-items: center;
            flex-wrap: wrap;
            margin-top: 10px;
        }

        .query-actions.compact {
            margin-top: 0;
        }

        .filter-tip {
            margin: 10px 0 0;
        }

        .gallery-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 14px;
        }

        /* 展厅：最多两列，上图下文（不再 3×3） */
        .showcase-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 16px;
            flex-wrap: wrap;
            margin-bottom: 8px;
        }

        .showcase-header .section-note {
            margin: 6px 0 0;
        }

        .showcase-list {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 18px;
            margin: 8px 0 4px;
        }

        @media (max-width: 860px) {
            .showcase-list {
                grid-template-columns: 1fr;
            }
        }

        .product-card-link {
            cursor: pointer;
        }

        tr.product-row-link:hover {
            background: #f0f7ff;
        }

        /* 详情：主图 3:4 + 附图缩略图 */
        .product-detail-layout {
            display: grid;
            grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
            align-items: start;
            gap: 28px 36px;
        }

        @media (max-width: 800px) {
            .product-detail-layout {
                grid-template-columns: 1fr;
                justify-items: center;
            }
        }

        .product-detail-visual {
            width: 100%;
            max-width: 320px;
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 12px;
        }

        .product-detail-media,
        .product-swiper {
            width: 100%;
            height: auto;
            aspect-ratio: 3 / 4;
            border-radius: 14px;
            box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
            flex-shrink: 0;
            position: relative;
            overflow: hidden;
            background: var(--img-frame);
            user-select: none;
        }

        /* 原生横向滚动 + scroll-snap，触摸滑动更稳 */
        .product-swiper-viewport {
            display: flex;
            width: 100%;
            height: 100%;
            overflow-x: auto;
            overflow-y: hidden;
            scroll-snap-type: x mandatory;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: none;
            touch-action: pan-x;
            cursor: grab;
        }

        .product-swiper-viewport::-webkit-scrollbar {
            display: none;
        }

        .product-swiper-viewport:active {
            cursor: grabbing;
        }

        .product-swiper-slide {
            flex: 0 0 100%;
            width: 100%;
            height: 100%;
            position: relative;
            scroll-snap-align: start;
            scroll-snap-stop: always;
        }

        .product-swiper-slide .product-detail-image {
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: center center;
            display: block;
            pointer-events: auto;
        }

        .product-swiper-nav {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            z-index: 2;
            width: 34px;
            height: 34px;
            border: none;
            border-radius: 999px;
            background: rgba(15, 23, 42, 0.55);
            color: #fff;
            font-size: 22px;
            line-height: 1;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0;
            backdrop-filter: blur(4px);
        }

        .product-swiper-nav:hover {
            background: rgba(15, 23, 42, 0.75);
        }

        .product-swiper-nav.prev { left: 8px; }
        .product-swiper-nav.next { right: 8px; }

        .product-swiper-meta {
            position: absolute;
            left: 8px;
            right: 8px;
            bottom: 8px;
            z-index: 2;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            pointer-events: none;
        }

        .product-swiper-meta .media-zoom-hint {
            position: static;
            left: auto;
            bottom: auto;
        }

        .product-swiper-counter {
            padding: 3px 8px;
            font-size: 11px;
            line-height: 1.2;
            color: #f8fafc;
            background: rgba(15, 23, 42, 0.55);
            border-radius: 6px;
            backdrop-filter: blur(4px);
            white-space: nowrap;
        }

        .product-gallery {
            display: flex;
            flex-wrap: wrap;
            justify-content: flex-start;
            gap: 8px;
            width: 100%;
        }

        @media (max-width: 800px) {
            .product-gallery {
                justify-content: center;
            }
        }

        .product-gallery-item {
            width: 56px;
            height: auto;
            aspect-ratio: 3 / 4;
            padding: 0;
            border: 2px solid transparent;
            border-radius: 8px;
            overflow: hidden;
            background: var(--img-frame);
            cursor: pointer;
            flex-shrink: 0;
        }

        .product-gallery-item.is-active,
        .product-gallery-item:hover {
            border-color: var(--primary);
        }

        .product-gallery-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: center;
            display: block;
        }

        .gallery-count {
            margin: 0;
            font-size: 12px;
        }

        .media-zoom-hint {
            position: absolute;
            left: 8px;
            bottom: 8px;
            z-index: 1;
            padding: 3px 8px;
            font-size: 11px;
            line-height: 1.2;
            color: #f8fafc;
            background: rgba(15, 23, 42, 0.55);
            border-radius: 6px;
            pointer-events: none;
            backdrop-filter: blur(4px);
        }

        .product-detail-placeholder {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #94a3b8;
            background: linear-gradient(160deg, var(--img-frame-soft), var(--img-frame));
            font-size: 13px;
        }

        .product-detail-fields {
            width: 100%;
            min-width: 0;
            max-width: 720px;
        }

        .detail-list {
            margin: 0;
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px 20px;
        }

        @media (max-width: 560px) {
            .detail-list {
                grid-template-columns: 1fr;
            }
        }

        .detail-list > div {
            border-bottom: 1px solid #eef2f7;
            padding-bottom: 8px;
        }

        .detail-list > div.span-2 {
            grid-column: 1 / -1;
        }

        .detail-list dt {
            margin: 0 0 3px;
            font-size: 12px;
            color: var(--muted);
            font-weight: 500;
        }

        .detail-list dd {
            margin: 0;
            font-size: 15px;
            color: #0f172a;
            word-break: break-word;
            white-space: pre-wrap;
        }

        /* 展厅卡片：通栏 3:4 上图 + 下文 */
        .product-card {
            display: flex;
            flex-direction: column;
            border: 1px solid var(--border);
            border-radius: 16px;
            overflow: hidden;
            background: #fff;
            box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
            transition: transform 0.22s ease, box-shadow 0.22s ease;
        }

        .product-card:hover {
            transform: translateY(-3px);
            box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
        }

        .product-card-media,
        .placeholder-image {
            width: 100%;
            height: auto;
            margin: 0;
            border-radius: 0;
            overflow: hidden;
            background: var(--img-frame);
            flex-shrink: 0;
        }

        .placeholder-image {
            display: flex;
            align-items: center;
            justify-content: center;
            color: #94a3b8;
            background: linear-gradient(160deg, var(--img-frame-soft), var(--img-frame));
            font-size: 13px;
            border: none;
            padding: 8px;
            text-align: center;
        }

        .product-card-body {
            padding: 14px 18px 18px;
            min-width: 0;
            text-align: center;
        }

        .product-title {
            margin: 0 0 4px;
            font-size: 16px;
            font-weight: 700;
            color: #0f172a;
            word-break: break-word;
        }

        .product-hq {
            margin: 0 0 12px;
            font-size: 13px;
            color: var(--primary);
            font-weight: 600;
            letter-spacing: 0.02em;
        }

        .product-meta-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px 12px;
            text-align: left;
            margin-bottom: 10px;
        }

        .product-meta-grid > div {
            padding: 8px 10px;
            border-radius: 10px;
            background: #f8fafc;
            border: 1px solid #eef2f7;
            min-width: 0;
        }

        .product-meta-grid span {
            display: block;
            font-size: 11px;
            color: var(--muted);
            margin-bottom: 2px;
        }

        .product-meta-grid strong {
            display: block;
            font-size: 13px;
            font-weight: 600;
            color: #1e293b;
            word-break: break-word;
        }

        .product-desc {
            margin: 0 0 10px;
            font-size: 13px;
            color: #475569;
            text-align: left;
            line-height: 1.45;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .product-card-cta {
            margin: 0;
            font-size: 12px;
            color: var(--primary);
            font-weight: 600;
        }

        .meta-item {
            margin: 0 0 4px;
            font-size: 12px;
            color: #334155;
            word-break: break-word;
        }

        .pagination-bar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            flex-wrap: wrap;
            margin: 12px 0;
            padding: 10px 12px;
            border: 1px solid var(--border);
            border-radius: 10px;
            background: #f8fafc;
        }

        .pagination-info {
            font-size: 13px;
            color: #475569;
        }

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

        .pagination-controls .page-link {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 34px;
            height: 32px;
            padding: 0 10px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: #fff;
            color: #334155;
            text-decoration: none;
            font-size: 13px;
        }

        .pagination-controls .page-link:hover {
            background: #eef2ff;
            border-color: #c7d2fe;
        }

        .pagination-controls .page-link.active {
            background: var(--primary);
            border-color: var(--primary);
            color: #fff;
            font-weight: 600;
        }

        .pagination-controls .page-link.disabled {
            opacity: 0.45;
            pointer-events: none;
        }

        .per-page-form {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-size: 13px;
            color: #475569;
        }

        .per-page-form select {
            min-width: 72px;
            padding: 6px 8px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: #fff;
        }

        .modal {
            position: fixed;
            inset: 0;
            display: none;
            align-items: center;
            justify-content: center;
            background: rgba(17, 24, 39, 0.68);
            z-index: 1000;
            padding: 16px;
        }

        .modal-content {
            width: min(86vw, 360px);
            max-height: min(85vh, calc(86vw * 4 / 3), 640px);
            aspect-ratio: 3 / 4;
            border-radius: 12px;
            overflow: hidden;
            background: #0b1220;
            border: none;
            box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
            padding: 0;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .modal-content img {
            display: block;
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: center center;
            background: transparent;
            border: none;
            padding: 0;
            margin: 0;
        }

        .modal-nav {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            z-index: 2;
            width: 42px;
            height: 42px;
            border: none;
            border-radius: 999px;
            background: rgba(15, 23, 42, 0.72);
            color: #fff;
            font-size: 28px;
            line-height: 1;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0;
        }

        .modal-nav.prev { left: 16px; }
        .modal-nav.next { right: 16px; }

        .modal-counter {
            position: absolute;
            left: 50%;
            bottom: 20px;
            transform: translateX(-50%);
            margin: 0;
            padding: 6px 12px;
            border-radius: 999px;
            background: rgba(15, 23, 42, 0.72);
            color: #f8fafc;
            font-size: 13px;
            z-index: 2;
            pointer-events: none;
        }

        .modal-close {
            position: absolute;
            top: 16px;
            right: 16px;
            background: rgba(15, 23, 42, 0.72);
            color: #fff;
            border: none;
            width: 36px;
            height: 36px;
            border-radius: 999px;
            cursor: pointer;
            font-size: 20px;
            line-height: 1;
            z-index: 2;
            backdrop-filter: blur(4px);
        }

        .modal-close:hover {
            background: rgba(15, 23, 42, 0.92);
        }

        /* 删除二次确认：紧凑小窗，固定在视口上方（不随表格滚动） */
        .confirm-modal.modal,
        .confirm-modal {
            position: fixed !important;
            inset: 0;
            display: none;
            align-items: flex-start;
            justify-content: center;
            padding: 72px 12px 12px;
            margin: 0;
            background: rgba(15, 23, 42, 0.4);
            z-index: 10000;
            overflow: auto;
            -webkit-overflow-scrolling: touch;
        }

        .confirm-dialog {
            width: min(300px, 88vw);
            max-width: 300px;
            margin: 0 auto;
            background: #fff;
            border-radius: 10px;
            padding: 14px 14px 12px;
            box-shadow: 0 12px 32px rgba(15, 23, 42, 0.2);
            border: 1px solid var(--border);
            flex-shrink: 0;
        }

        .confirm-dialog h3 {
            margin: 0 0 6px;
            font-size: 15px;
            font-weight: 600;
            color: #0f172a;
        }

        .confirm-lead {
            margin: 0 0 4px;
            font-size: 13px;
            line-height: 1.4;
            color: #334155;
            word-break: break-word;
        }

        .confirm-note {
            margin: 0 0 10px;
            font-size: 11px;
            line-height: 1.35;
        }

        .confirm-warn {
            margin: 0 0 8px;
            font-size: 12px;
            line-height: 1.4;
            color: #991b1b;
        }

        .confirm-label {
            display: block;
            margin-bottom: 4px;
            font-size: 12px;
            color: #64748b;
        }

        .confirm-input {
            width: 100%;
            margin-bottom: 4px;
            padding: 7px 9px;
            border: 1px solid var(--border);
            border-radius: 6px;
            font-size: 13px;
        }

        .confirm-input:focus {
            border-color: #fca5a5;
            outline: 2px solid #fee2e2;
        }

        .confirm-hint {
            margin: 0 0 10px;
            font-size: 11px;
        }

        .confirm-hint.is-ok {
            color: #15803d;
        }

        .confirm-actions {
            display: flex;
            justify-content: flex-end;
            gap: 6px;
            flex-wrap: wrap;
        }

        .confirm-actions .btn {
            padding: 6px 12px;
            font-size: 13px;
            border-radius: 6px;
        }

        .btn.danger:disabled {
            opacity: 0.45;
            cursor: not-allowed;
        }

        .section-note {
            margin-top: -6px;
            margin-bottom: 12px;
        }

        .auth-panel {
            max-width: 460px;
            margin: 10px auto;
        }

        .auth-brand {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 8px;
        }

        .auth-brand .panel-title {
            margin: 0;
        }

        .auth-brand .muted {
            margin: 4px 0 0;
        }

        .auth-logo {
            width: 42px;
            height: 42px;
            border-radius: 10px;
            background: linear-gradient(135deg, #2563eb, #7c3aed);
            color: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            box-shadow: 0 10px 24px rgba(79, 70, 229, 0.32);
        }

        .form-actions {
            margin-top: 8px;
        }

        .empty-tip {
            margin: 0;
        }

        .search-tip {
            margin: 0 0 10px;
        }

        .btn-wecom {
            background: linear-gradient(135deg, #07c160, #06ae56);
            box-shadow: 0 7px 14px rgba(7, 193, 96, 0.24);
        }

        .btn-wecom:hover {
            background: #06ae56;
        }

        .auth-divider {
            display: flex;
            align-items: center;
            gap: 10px;
            margin: 16px 0;
            color: var(--muted);
            font-size: 12px;
        }

        .auth-divider::before,
        .auth-divider::after {
            content: "";
            flex: 1;
            height: 1px;
            background: var(--border);
        }

        .role-form select {
            width: auto;
            min-width: 110px;
        }

        .status-badge {
            display: inline-flex;
            align-items: center;
            padding: 4px 8px;
            border-radius: 999px;
            font-size: 12px;
            font-weight: 600;
            border: 1px solid var(--border);
            background: #f8fafc;
        }

        .status-badge.won,
        .status-badge.completed,
        .status-badge.confirmed {
            border-color: #bbf7d0;
            background: #f0fdf4;
            color: #166534;
        }

        .status-badge.following,
        .status-badge.production {
            border-color: #bfdbfe;
            background: #eff6ff;
            color: #1d4ed8;
        }

        .status-badge.draft,
        .status-badge.potential {
            border-color: #fde68a;
            background: #fffbeb;
            color: #92400e;
        }

        .status-badge.lost,
        .status-badge.cancelled,
        .status-badge.rejected,
        .status-badge.expired {
            border-color: #fecaca;
            background: #fef2f2;
            color: #b91c1c;
        }

        .status-badge.sent,
        .status-badge.shipped {
            border-color: #c4b5fd;
            background: #f5f3ff;
            color: #6d28d9;
        }

        .status-badge.accepted {
            border-color: #86efac;
            background: #f0fdf4;
            color: #15803d;
        }

        .funnel-wrap {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            margin: 16px 0 8px;
        }

        .funnel-step {
            display: flex;
            justify-content: space-between;
            align-items: center;
            min-width: 280px;
            padding: 12px 16px;
            border-radius: 10px;
            color: #fff;
            font-size: 14px;
            transition: transform 0.2s ease;
        }

        .funnel-step:hover {
            transform: scale(1.02);
        }

        .funnel-potential { background: linear-gradient(135deg, #f59e0b, #d97706); }
        .funnel-following { background: linear-gradient(135deg, #3b82f6, #2563eb); }
        .funnel-won { background: linear-gradient(135deg, #10b981, #059669); }
        .funnel-lost { background: linear-gradient(135deg, #ef4444, #dc2626); }

        .order-lines {
            display: grid;
            gap: 10px;
        }

        .order-line {
            display: grid;
            grid-template-columns: 2fr 1fr 1fr 1fr auto;
            gap: 8px;
            align-items: end;
        }

        .nav-links .btn.light.active {
            background: linear-gradient(135deg, #dbeafe, #e0e7ff);
            color: #1d4ed8;
            border-color: #93c5fd;
            font-weight: 600;
        }

        .form-section {
            margin-top: 18px;
            padding: 16px;
            border: 1px solid var(--border);
            border-radius: 12px;
            background: linear-gradient(180deg, #fafcff 0%, #fff 100%);
        }

        .form-section-title {
            margin: 0 0 12px;
            font-size: 15px;
            font-weight: 600;
            color: #1e3a8a;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .form-section-title::before {
            content: "";
            width: 4px;
            height: 16px;
            border-radius: 2px;
            background: var(--primary);
        }

        .pi-preview {
            margin-top: 10px;
            padding: 12px 14px;
            border-radius: 10px;
            background: #f0f7ff;
            border: 1px dashed #93c5fd;
            font-size: 13px;
            color: #1e40af;
            line-height: 1.6;
        }

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

        .file-input-hidden {
            position: absolute;
            width: 1px;
            height: 1px;
            opacity: 0;
            overflow: hidden;
        }

        .image-upload-area {
            position: relative;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .upload-controls {
            border: 1px dashed var(--border);
            border-radius: 12px;
            padding: 14px 16px;
            background: #fafcff;
        }

        .upload-controls input[type="file"] {
            display: block;
            width: 100%;
            max-width: 420px;
            font-size: 14px;
        }

        .upload-hint {
            margin: 8px 0 0;
            font-size: 12px;
        }

        .upload-error {
            margin: 8px 0 0;
            color: var(--danger);
            font-size: 13px;
        }

        .upload-status {
            margin: 8px 0 0;
            color: #0b6e4f;
            font-size: 13px;
        }

        .upload-placeholder {
            border: 2px dashed var(--border);
            border-radius: 12px;
            padding: 28px 16px;
            text-align: center;
            transition: border-color 0.2s, background 0.2s;
        }

        .upload-placeholder:hover {
            border-color: var(--primary);
            background: var(--primary-soft);
        }

        .upload-label {
            cursor: pointer;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
            color: var(--muted);
            font-size: 14px;
        }

        .upload-icon {
            font-size: 32px;
            font-weight: 300;
            color: var(--primary);
            line-height: 1;
        }

        .current-image-box,
        .new-image-box {
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 12px;
            background: #fafcff;
        }

        .current-image-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
        }

        .image-actions {
            display: flex;
            gap: 6px;
        }

        .image-preview-frame {
            width: min(100%, 240px);
            height: auto;
            border-radius: 12px;
            box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
        }

        .image-preview {
            cursor: zoom-in;
        }

        .btn-sm {
            padding: 4px 10px;
            font-size: 12px;
            border-radius: 6px;
        }

        .hidden {
            display: none !important;
        }

        .product-combo {
            position: relative;
        }

        .product-combo-input {
            width: 100%;
        }

        .product-combo-input.invalid {
            border-color: var(--danger);
            background: #fef2f2;
        }

        .product-combo-list {
            position: absolute;
            z-index: 30;
            top: calc(100% + 2px);
            left: 0;
            right: 0;
            max-height: 260px;
            overflow-y: auto;
            background: #fff;
            border: 1px solid var(--border);
            border-radius: 10px;
            box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
            display: none;
        }

        .product-combo-list.open {
            display: block;
        }

        .product-combo-item {
            padding: 8px 12px;
            cursor: pointer;
            font-size: 13px;
            line-height: 1.4;
            border-bottom: 1px solid #f1f5f9;
        }

        .product-combo-item:last-child {
            border-bottom: none;
        }

        .product-combo-item:hover,
        .product-combo-item.active {
            background: var(--primary-soft);
        }

        .product-combo-item .pc-main {
            font-weight: 600;
            color: var(--text);
        }

        .product-combo-item .pc-sub {
            color: var(--muted);
            font-size: 12px;
        }

        .product-combo-empty {
            padding: 10px 12px;
            color: var(--muted);
            font-size: 13px;
        }

        .order-lines-pi .order-line {
            grid-template-columns: 2fr 1fr 0.8fr 1fr 0.8fr 1.2fr auto;
        }

        @media (max-width: 820px) {
            .order-line {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 820px) {
            body {
                padding: 14px 10px;
            }

            .container {
                padding: 16px;
            }

            .form-grid {
                grid-template-columns: 1fr;
            }

            .span-2 {
                grid-column: span 1;
            }

            .nav {
                flex-direction: column;
                align-items: flex-start;
            }

            .stats-grid {
                grid-template-columns: 1fr;
            }

            .search-input {
                min-width: 200px;
            }

            .query-grid {
                grid-template-columns: 1fr;
            }
        }
