    :root { --sidebar-w: 240px; }

    body.market-page {
      margin: 0;
      background: var(--bg);
      color: var(--text);
      min-height: 100vh;
    }

    .market-wrapper {
      width: min(1400px, calc(100% - 32px));
      margin: 32px auto;
      display: flex;
      gap: 32px;
    }

    /* 侧边栏布局 */
    .market-sidebar {
      width: var(--sidebar-w);
      flex-shrink: 0;
    }
    .sticky-sidebar {
      position: sticky;
      top: 100px;
      display: flex;
      flex-direction: column;
      gap: 20px;
    }

    /* 侧边栏导航卡片 */
    .category-nav {
      background: var(--panel);
      border-radius: 24px;
      border: 1px solid var(--line);
      padding: 12px;
      display: flex;
      flex-direction: column;
      gap: 4px;
      box-shadow: 0 10px 25px rgba(0, 0, 0, 0.02);
    }

    .nav-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px 16px;
      border-radius: 14px;
      color: var(--muted);
      text-decoration: none;
      font-size: 14px;
      font-weight: 700;
      transition: all 0.2s;
    }
    .nav-item:hover {
      background: var(--primary-a1);
      color: var(--primary);
    }
    .nav-item.active {
      background: var(--primary);
      color: #fff;
      box-shadow: 0 4px 12px var(--primary-a2);
    }
    .nav-item-icon {
       font-size: 20px;
       width: 24px;
       height: 24px; /* 增加固定高度 */
       display: flex;
       align-items: center; /* 垂直居中 */
       justify-content: center;
       flex-shrink: 0;
     }
     .nav-item-icon svg, 
     .nav-item-icon img {
       width: 100% !important;
       height: 100% !important;
       max-width: 22px; /* 进一步限制实际视觉大小 */
       max-height: 22px;
       object-fit: contain;
     }

    /* 发布按钮卡片 */
    .publish-card {
      background: var(--panel);
      border-radius: 24px;
      border: 1px solid var(--line);
      padding: 16px;
      box-shadow: 0 10px 25px rgba(0, 0, 0, 0.02);
    }
    .btn-publish {
      width: 100%;
      background: var(--primary);
      color: #fff;
      padding: 14px;
      border-radius: 16px;
      font-weight: 800;
      text-decoration: none;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      border: none;
      cursor: pointer;
      transition: all 0.3s;
      font-size: 15px;
    }
    .btn-publish:hover {
      background: var(--primary-hover);
      transform: translateY(-2px);
      box-shadow: 0 8px 20px var(--primary-a3);
    }

    /* 主内容区 */
    .market-main {
      flex: 1;
      min-width: 0;
    }

    .market-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 32px;
      gap: 20px;
    }
    .market-title {
      flex: 1;
    }
    .market-search-box {
      width: 280px;
      position: relative;
      margin-top: 5px;
    }
    .market-search-input {
      width: 100%;
      height: 44px;
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 14px;
      padding: 0 45px 0 16px;
      font-size: 14px;
      font-weight: 600;
      color: var(--text);
      transition: all 0.3s;
      box-sizing: border-box;
    }
    .market-search-input:focus {
      outline: none;
      border-color: var(--primary);
      box-shadow: 0 0 0 4px var(--primary-a1);
    }
    .market-search-btn {
      position: absolute;
      right: 5px;
      top: 5px;
      width: 34px;
      height: 34px;
      background: var(--primary);
      color: #fff;
      border: none;
      border-radius: 10px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s;
    }
    .market-search-btn:hover {
      transform: scale(1.05);
      filter: brightness(1.1);
    }

    @media (max-width: 768px) {
      .market-header {
        flex-direction: column;
        margin-bottom: 24px;
      }
      .market-search-box {
        width: 100%;
      }
    }
    .market-title h2 { margin: 0; font-size: 24px; font-weight: 900; color: var(--text); }
    .market-title p { margin: 0; font-size: 14px; color: var(--muted); }

    /* 顶部二级分类 */
    .category-tabs-row {
      margin-bottom: 24px;
    }
    .category-tabs {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }
    .category-tab {
      padding: 8px 16px;
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 12px;
      font-size: 13px;
      font-weight: 700;
      color: var(--muted);
      text-decoration: none;
      transition: all 0.2s;
    }
    .category-tab:hover { border-color: var(--primary); color: var(--primary); }
    .category-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
    .active-count { font-size: 11px; opacity: 0.8; margin-left: 4px; }

    /* 轻量级 Toast 提示 */
    .toast-container {
        position: fixed;
        top: 20px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 9999;
        display: flex;
        flex-direction: column;
        gap: 10px;
        pointer-events: none;
    }
    .toast-item {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border: 1px solid var(--line);
        padding: 12px 24px;
        border-radius: 14px;
        box-shadow: 0 10px 25px rgba(0,0,0,0.1);
        display: flex;
        align-items: center;
        gap: 10px;
        animation: toastIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
        pointer-events: auto;
    }
    .toast-item.error { border-color: #fee2e2; background: #fff1f2; }
    .toast-icon { font-size: 18px; }
    .toast-msg { font-size: 14px; font-weight: 700; color: var(--text); }
    .toast-item.error .toast-msg { color: #e11d48; }

    @keyframes toastIn {
        from { opacity: 0; transform: translateY(-20px); }
        to { opacity: 1; transform: translateY(0); }
    }
    @keyframes toastOut {
        from { opacity: 1; transform: scale(1); }
        to { opacity: 0; transform: scale(0.9); }
    }

    /* 空状态样式优化 */
    .empty-state {
      grid-column: 1 / -1; /* 跨越所有网格列以实现水平居中 */
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 80px 20px;
      background: var(--panel);
      border-radius: 32px;
      border: 1px dashed var(--line);
      text-align: center;
    }
    .empty-state-icon {
      font-size: 64px;
      margin-bottom: 20px;
      opacity: 0.8;
      filter: grayscale(0.5);
    }
    .empty-state-title {
      font-size: 18px;
      font-weight: 900;
      color: var(--text);
      margin-bottom: 8px;
    }
    .empty-state-desc {
      font-size: 14px;
      color: var(--muted);
      max-width: 260px;
      line-height: 1.6;
    }

    /* 商品网格 - 每行显示4个 */
    .product-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 20px;
    }

    .product-card-wrapper {
      position: relative;
      height: 124px;
      min-width: 0;
      width: 100%;
    }
    .product-card {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 20px;
      padding: 16px;
      display: flex;
      flex-direction: column;
      height: 100%; 
      width: 100%; /* 确保填满 wrapper */
      cursor: pointer;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      position: relative;
      box-sizing: border-box;
      overflow: hidden;
      text-decoration: none !important; 
      color: inherit !important;
    }
    .product-card:hover {
      transform: translateY(-5px);
      box-shadow: 0 15px 35px rgba(0,0,0,0.05);
      border-color: var(--primary);
    }
    
    .product-top {
      display: flex;
      align-items: center; /* 改回居中对齐，更像工具卡片 */
      gap: 12px;
      min-width: 0;
      flex: 1; /* 占据上半部分空间 */
    }
    .product-icon {
      width: 40px; /* 对齐在线工具图标大小 */
      height: 40px;
      background: var(--bg);
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      flex-shrink: 0;
      color: var(--primary);
    }
    .product-info { 
      min-width: 0; 
      flex: 1;
      display: flex;
      flex-direction: column;
      justify-content: center;
      padding-right: 40px; /* 为右上角按钮预留空间，防止重叠 */
    }
    .product-title {
      font-size: 15px;
      font-weight: 900;
      margin: 0 0 6px 0;
      color: var(--text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .product-desc {
      margin: 0;
      font-size: 11px;
      color: var(--muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      line-height: 1.5;
    }
    .product-bottom {
      margin-top: auto;
      padding-top: 10px;
      border-top: 1px solid var(--line);
      display: flex;
      justify-content: space-between;
      align-items: center;
      height: 32px; /* 固定底栏高度 */
    }
    .product-price { color: #ef4444; font-weight: 800; font-size: 14px; }
    .product-stock { font-size: 11px; color: var(--muted); }

    /* 弹窗样式调整 */

    .loading-overlay {
        position: fixed;
        top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(var(--bg-rgb, 248, 250, 252), 0.7);
        backdrop-filter: blur(4px);
        z-index: 1000;
        display: none;
        align-items: center;
        justify-content: center;
    }
    .loading-overlay.show { display: flex; }
    .loading-state { text-align: center; }
    .loading-spinner {
        width: 40px;
        height: 40px;
        border: 4px solid var(--line);
        border-top-color: var(--primary);
        border-radius: 50%;
        animation: spin 1s linear infinite;
        margin: 0 auto 15px;
    }
    @keyframes spin { to { transform: rotate(360deg); } }
    .modal-overlay {
        position: fixed;
        top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(0,0,0,0.4);
        z-index: 2000;
        display: none;
        align-items: center;
        justify-content: center;
    }
    .modal-content {
        background: var(--panel);
        width: min(560px, 95%);
        border-radius: 20px;
        padding: 0; /* 移除默认内边距 */
        border: 1px solid var(--line);
        box-shadow: 0 30px 60px rgba(0,0,0,0.2);
        overflow: hidden; /* 确保头部圆角生效 */
    }
    .modal-header { 
        display: flex; 
        justify-content: space-between; 
        align-items: center; 
        padding: 12px 20px; /* 压缩高度 */
        background: var(--primary); /* 绿色背景 */
        color: #fff;
    }
    .modal-title { font-size: 18px; font-weight: 800; color: #fff; }
    .modal-close { 
        background: rgba(255,255,255,0.15); 
        border: none; 
        width: 32px;
        height: 32px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px; 
        cursor: pointer; 
        color: #fff; 
        transition: all 0.2s;
    }
    .modal-close:hover { background: rgba(255,255,255,0.25); }
    
    .product-form-body {
        padding: 24px; /* 表单内容内边距 */
    }
    
    .form-group { margin-bottom: 16px; }
    .form-label { display: block; font-size: 13px; font-weight: 800; color: var(--muted); margin-bottom: 6px; }
    .form-control {
        width: 100%;
        padding: 12px 16px;
        border-radius: 14px;
        border: 1px solid var(--line);
        background: var(--bg);
        color: var(--text);
        font-family: inherit;
        font-size: 14px;
        font-weight: 600;
        transition: all 0.2s;
        box-sizing: border-box;
    }
    .form-control:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 4px var(--primary-a1); }
    
    /* 站长操作按钮优化 */
    .product-actions {
      position: absolute;
      top: 6px;
      right: 6px;
      display: flex;
      gap: 4px;
      opacity: 0;
      transform: scale(0.9);
      transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      z-index: 50;
      background: rgba(255,255,255,0.8);
      backdrop-filter: blur(4px);
      padding: 4px;
      border-radius: 10px;
      box-shadow: 0 4px 12px rgba(0,0,0,0.05);
      pointer-events: none; /* 初始不可点击 */
    }
    .product-card-wrapper:hover .product-actions {
      opacity: 1;
      transform: scale(1);
      pointer-events: auto; /* 悬浮时可点击 */
    }
    .action-btn {
      width: 26px; /* 进一步缩小按钮 */
      height: 26px;
      border-radius: 6px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 12px; /* 缩小图标 */
      cursor: pointer;
      border: none;
      transition: all 0.2s;
      color: inherit;
    }
    .action-btn i {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        opacity: 1 !important;
        visibility: visible !important;
    }
    .btn-edit { background: #f1f5f9; color: #64748b; }
    .btn-delete { background: #fee2e2; color: #ef4444; }
    .btn-edit:hover { background: var(--primary); color: #fff; }
    .btn-delete:hover { background: #ef4444; color: #fff; }

    /* 确认模态框特有样式 */
    .modal-confirm {
        max-width: 360px !important;
        text-align: center;
        padding: 30px !important;
    }
    .confirm-icon {
        font-size: 48px;
        margin-bottom: 16px;
        color: #ef4444;
    }
    .confirm-title {
        font-size: 18px;
        font-weight: 900;
        margin-bottom: 10px;
        color: var(--text);
    }
    .confirm-text {
        color: var(--muted);
        margin-bottom: 24px;
        line-height: 1.6;
        font-size: 14px;
    }
    .confirm-btns {
        display: flex;
        gap: 12px;
        justify-content: center;
    }
    .confirm-btns .btn {
        flex: 1;
        padding: 10px;
        border-radius: 12px;
        font-weight: 800;
        font-size: 14px;
        cursor: pointer;
        border: none;
        transition: all 0.2s;
    }
    .btn-confirm-cancel { background: var(--bg); color: var(--muted); }
    .btn-confirm-delete { background: #ef4444; color: #fff; }
    .btn-confirm-delete:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); }

    @media (max-width: 1200px) {
      .product-grid { grid-template-columns: repeat(3, 1fr); }
    }
    @media (max-width: 992px) {
      .market-wrapper { flex-direction: column; gap: 24px; }
      .market-sidebar { width: 100%; }
      .sticky-sidebar { position: static; }
      .product-grid { grid-template-columns: repeat(2, 1fr); }
    }
    @media (max-width: 576px) {
      .product-grid { grid-template-columns: 1fr; }
    }
      /* SVG 图标缩放修复 */
      .product-icon svg,
      .svg-icon-container svg {
          width: 100% !important;
          height: 100% !important;
          max-width: 100%;
          max-height: 100%;
      }
