* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: #333;
  background: #f5f6f8;
  -webkit-font-smoothing: antialiased;
  min-width: 1200px;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  outline: none;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-thumb {
  background: #d0d5dd;
  border-radius: 3px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* ============ Login Page ============ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ffe0ec 0%, #fff5f8 50%, #ffe8f0 100%);
}

.login-box {
  width: 400px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(255, 105, 180, 0.15);
  padding: 48px 40px;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #ff69b4, #ffb6c1);
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
}

.login-title {
  font-size: 22px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 8px;
}

.login-subtitle {
  font-size: 13px;
  color: #9ca3af;
}

.login-form .form-group {
  margin-bottom: 20px;
}

.login-form label {
  display: block;
  font-size: 13px;
  color: #4b5563;
  margin-bottom: 8px;
  font-weight: 500;
}

.login-form input {
  width: 100%;
  height: 44px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0 16px;
  transition: all 0.2s;
  background: #fafbfc;
}

.login-form input:focus {
  border-color: #ff69b4;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.1);
}

.login-form .btn-primary {
  width: 100%;
  height: 46px;
  background: linear-gradient(135deg, #ff69b4, #ff8ec1);
  color: #fff;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(255, 105, 180, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(255, 105, 180, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.login-error {
  color: #ef4444;
  font-size: 13px;
  margin-bottom: 16px;
  min-height: 18px;
  text-align: center;
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 12px;
  color: #9ca3af;
}

/* ============ Layout ============ */
.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 220px;
  background: linear-gradient(180deg, #1f2937 0%, #2d3748 100%);
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-logo {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #ff69b4, #ffb6c1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
}

.sidebar-logo-text {
  font-size: 16px;
  font-weight: 600;
}

.sidebar-logo-sub {
  font-size: 11px;
  color: #9ca3af;
}

.nav-menu {
  list-style: none;
  padding: 12px 0;
}

.nav-section {
  padding: 16px 24px 8px;
  font-size: 11px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: #d1d5db;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 14px;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(255, 105, 180, 0.15), transparent);
  border-left-color: #ff69b4;
  color: #fff;
}

.nav-item-icon {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.nav-badge {
  margin-left: auto;
  background: #ff69b4;
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
}

/* 二级子菜单：与主菜单同风格，缩进对齐（多缩进 8px 左右） */
.nav-group {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: #d1d5db;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 14px;
  border-left: 3px solid transparent;
}
.nav-group:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}
.nav-group.active {
  background: linear-gradient(90deg, rgba(255, 105, 180, 0.15), transparent);
  border-left-color: #ff69b4;
  color: #fff;
}
.nav-group-label {
  flex: 1;
}
.nav-group-arrow {
  font-size: 10px;
  color: #9ca3af;
  transition: transform 0.15s;
}
.nav-group:hover .nav-group-arrow,
.nav-group.active .nav-group-arrow {
  color: #ff69b4;
}

.nav-sub-wrap {
  overflow: hidden;
  transition: all 0.2s;
}
.nav-sub-hide {
  display: none;
}
.nav-sub-menu {
  list-style: none;
  padding: 4px 0 8px;
  margin: 0;
}
.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 12px;
  /* 与主标题左对齐：主图标宽20 + gap12 + 左边24  共56；子菜单再缩进 12 */
  padding: 10px 24px 10px 56px;
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 13px;
  border-left: 3px solid transparent;
  line-height: 1.4;
}
.nav-sub-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}
.nav-sub-item.active {
  background: linear-gradient(90deg, rgba(255, 105, 180, 0.15), transparent);
  border-left-color: #ff69b4;
  color: #fff;
}
/* 子项图标对齐：统一缩放到 16px，视觉上与主菜单文本对齐 */
.nav-sub-item .nav-item-icon {
  font-size: 14px;
  width: 16px;
  opacity: 0.9;
}

/* Main area */
.main {
  margin-left: 220px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.topbar {
  height: 60px;
  background: #fff;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-breadcrumb {
  font-size: 14px;
  color: #6b7280;
}

.topbar-breadcrumb span {
  color: #1f2937;
  font-weight: 500;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.topbar-search {
  position: relative;
}

.topbar-search input {
  width: 240px;
  height: 36px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 0 16px 0 36px;
  background: #f9fafb;
}

.topbar-search input:focus {
  background: #fff;
  border-color: #ff69b4;
}

.topbar-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 14px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 20px;
  transition: background 0.15s;
}

.topbar-user:hover {
  background: #f9fafb;
}

.topbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff69b4, #ffb6c1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
}

.topbar-username {
  font-size: 14px;
  color: #1f2937;
  font-weight: 500;
}

.topbar-logout {
  font-size: 13px;
  color: #ef4444;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 6px;
  transition: background 0.15s;
}

.topbar-logout:hover {
  background: #fef2f2;
}

/* Content */
.content {
  flex: 1;
  padding: 24px 32px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

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

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

/* Cards */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  padding: 24px;
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
}

/* Stats cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, rgba(255, 105, 180, 0.08), transparent);
  border-radius: 0 0 0 80px;
}

.stat-label {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 12px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 8px;
}

.stat-change {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change.up {
  color: #10b981;
}

.stat-change.down {
  color: #ef4444;
}

.stat-icon {
  position: absolute;
  right: 20px;
  top: 20px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.stat-icon.pink { background: linear-gradient(135deg, #ffe0ec, #ffc9dc); color: #ff69b4; }
.stat-icon.blue { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #3b82f6; }
.stat-icon.purple { background: linear-gradient(135deg, #ede9fe, #ddd6fe); color: #8b5cf6; }
.stat-icon.orange { background: linear-gradient(135deg, #fed7aa, #fdba74); color: #f97316; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-sm {
  height: 30px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 6px;
}

.btn-lg {
  height: 44px;
  padding: 0 24px;
  font-size: 15px;
  border-radius: 10px;
}

.btn-primary {
  background: linear-gradient(135deg, #ff69b4, #ff8ec1);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 105, 180, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 6px 16px rgba(255, 105, 180, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #fff;
  color: #4b5563;
  border: 1px solid #d1d5db;
}

.btn-secondary:hover {
  border-color: #ff69b4;
  color: #ff69b4;
}

.btn-danger {
  background: #fff;
  color: #ef4444;
  border: 1px solid #fecaca;
}

.btn-danger:hover {
  background: #fef2f2;
}

.btn-text {
  background: transparent;
  color: #ff69b4;
  padding: 0 8px;
  height: auto;
}

.btn-text:hover {
  text-decoration: underline;
}

.btn-block {
  width: 100%;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  color: #374151;
  margin-bottom: 8px;
  font-weight: 500;
}

.form-label .required {
  color: #ef4444;
  margin-left: 2px;
}

.form-control {
  width: 100%;
  height: 40px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  transition: all 0.15s;
}

.form-control:focus {
  border-color: #ff69b4;
  box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.1);
}

textarea.form-control {
  height: auto;
  padding: 12px 14px;
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.form-section-title {
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
  margin: 24px 0 16px;
  padding-left: 12px;
  border-left: 3px solid #ff69b4;
}

.form-hint {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 6px;
}

/* Upload */
.upload-area {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.upload-item {
  width: 100px;
  height: 100px;
  border: 1px dashed #d1d5db;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  background: #fafbfc;
  position: relative;
  overflow: hidden;
}

.upload-item:hover {
  border-color: #ff69b4;
  background: #fff5f8;
}

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

.upload-item-add {
  flex-direction: column;
  color: #9ca3af;
  font-size: 12px;
  gap: 4px;
}

.upload-item-add .icon {
  font-size: 24px;
}

.upload-item-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

/* Status radios */
.status-radios {
  display: flex;
  gap: 12px;
}

.status-radio {
  flex: 1;
  position: relative;
}

.status-radio input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.status-radio label {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  background: #fff;
  font-size: 14px;
  color: #4b5563;
}

.status-radio input:checked + label {
  border-color: #ff69b4;
  background: #fff5f8;
  color: #ff69b4;
  font-weight: 500;
}

/* Tables */
.table-container {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid #f3f4f6;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead {
  background: #f9fafb;
}

th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  color: #374151;
  font-size: 13px;
  border-bottom: 1px solid #f3f4f6;
  white-space: nowrap;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid #f3f4f6;
  color: #4b5563;
  white-space: nowrap;
  vertical-align: middle;
}

/* 订单管理表格：信息区可横向滑动，操作列固定右侧 */
.table-container table {
  width: max-content;
  min-width: 100%;
}

/* 操作列固定在右侧 */
th.col-actions,
td.col-actions {
  position: sticky;
  right: 0;
  background: #ffffff;
  z-index: 10;
  box-shadow: -4px 0 8px -4px rgba(0, 0, 0, 0.08);
}

thead th.col-actions {
  background: #f9fafb;
}

tbody tr:nth-child(even) td.col-actions {
  background: #fafbfc;
}

tbody tr:hover td.col-actions {
  background: #fff5f8;
}

tbody tr:last-child td.col-actions {
  background: #fff;
}

tbody tr {
  transition: background 0.1s;
}

tbody tr:nth-child(even) {
  background: #fafbfc;
}

tbody tr:hover {
  background: #fff5f8;
}

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

.table-thumb {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
  background: #f3f4f6;
}

.table-placeholder-img {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffe0ec, #ffc9dc);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff69b4;
  font-size: 20px;
}

.table-product-img {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #f0f0f0;
}

.table-product-img-loading {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffe0ec, #ffc9dc);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #f0f0f0;
  animation: pulse-loading 1.5s ease-in-out infinite;
}

.img-loading-placeholder {
  color: #ff69b4;
  font-size: 20px;
}

@keyframes pulse-loading {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Status tags */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.tag-green {
  background: #d1fae5;
  color: #065f46;
}

.tag-red {
  background: #fee2e2;
  color: #991b1b;
}

.tag-yellow {
  background: #fef3c7;
  color: #92400e;
}

.tag-blue {
  background: #dbeafe;
  color: #1e40af;
}

.tag-purple {
  background: #ede9fe;
  color: #5b21b6;
}

.tag-pink {
  background: #fce7f3;
  color: #9d174d;
}

.tag-gray {
  background: #f3f4f6;
  color: #4b5563;
}

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

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

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-input {
  position: relative;
}

.search-input input {
  width: 260px;
  height: 36px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0 14px 0 36px;
  background: #fff;
}

.search-input input:focus {
  border-color: #ff69b4;
  box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.1);
}

.search-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 14px;
}

.filter-select {
  height: 36px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: #4b5563;
  min-width: 140px;
}

.filter-select:focus {
  border-color: #ff69b4;
}

/* Pagination */
.pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
  padding: 16px 0 8px;
  gap: 12px;
}

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

.pagination-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.page-size-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #6b7280;
}

.page-size-select {
  height: 32px;
  min-width: 64px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 0 8px;
  background: #fff;
  color: #4b5563;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.page-size-select:hover {
  border-color: #ff69b4;
}

.page-size-select:focus {
  border-color: #ff69b4;
  box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.1);
  outline: none;
}

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

.page-btn {
  min-width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #4b5563;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.page-btn:hover:not(:disabled) {
  border-color: #ff69b4;
  color: #ff69b4;
}

.page-btn.active {
  background: linear-gradient(135deg, #ff69b4, #ff8ec1);
  color: #fff;
  border-color: transparent;
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 2px solid #f3f4f6;
  margin-bottom: 24px;
  gap: 4px;
}

.tab {
  padding: 12px 20px;
  cursor: pointer;
  font-size: 14px;
  color: #6b7280;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
  font-weight: 500;
}

.tab:hover {
  color: #ff69b4;
}

.tab.active {
  color: #ff69b4;
  border-bottom-color: #ff69b4;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: #fff;
  border-radius: 14px;
  width: 480px;
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.2s;
}

.modal-overlay.show .modal {
  transform: scale(1);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 17px;
  font-weight: 600;
  color: #1f2937;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #9ca3af;
  transition: all 0.15s;
}

.modal-close:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.modal-body {
  padding: 24px;
  max-height: 70vh;
  overflow-y: auto;
}

/* ============ 订单详情 ============ */
.detail-section {
  border-bottom: 1px dashed #e5e7eb;
  padding-bottom: 20px;
  margin-bottom: 20px;
}
.detail-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}
.detail-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid #ff69b4;
  display: inline-block;
  padding-right: 12px;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}
.detail-row {
  display: flex;
  align-items: flex-start;
  padding: 6px 0;
  font-size: 13px;
}
.detail-label {
  color: #6b7280;
  width: 92px;
  flex-shrink: 0;
}
.detail-value {
  color: #111827;
  word-break: break-all;
  flex: 1;
}
.detail-product-card {
  display: flex;
  gap: 16px;
  background: #fafafa;
  border-radius: 10px;
  padding: 16px;
}
.detail-product-media {
  width: 92px;
  height: 92px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #f3f4f6;
}
.detail-product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.detail-product-cover {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  background: #fff5f8;
}
.detail-product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

@media (max-width: 640px) {
  .detail-grid { grid-template-columns: 1fr; }
  .detail-product-card { flex-direction: column; }
  .detail-product-media { width: 100%; height: 180px; }
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Toast */
.toast-container {
  position: fixed;
  top: 80px;
  right: 32px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #fff;
  border-radius: 10px;
  padding: 14px 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease;
  min-width: 240px;
}

.toast.success { border-left: 4px solid #10b981; }
.toast.error { border-left: 4px solid #ef4444; }
.toast.info { border-left: 4px solid #3b82f6; }
.toast.warning { border-left: 4px solid #f59e0b; }

.toast-icon {
  font-size: 18px;
}

.toast.success .toast-icon { color: #10b981; }
.toast.error .toast-icon { color: #ef4444; }
.toast.info .toast-icon { color: #3b82f6; }
.toast.warning .toast-icon { color: #f59e0b; }

.toast-message {
  font-size: 14px;
  color: #1f2937;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Print area */
.print-area {
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  margin-top: 16px;
}

.print-barcode {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px dashed #d1d5db;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 13px;
}

.print-barcode .bc-product {
  font-weight: 500;
  color: #1f2937;
}

.print-barcode .bc-code {
  font-family: monospace;
  color: #6b7280;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 4px;
}

/* ============ 条形码标签预览 ============ */
.label-preview-container {
  display: flex;
  justify-content: center;
  padding: 20px;
  background: #f9fafb;
  border-radius: 8px;
}

.label-preview-item {
  width: 240px;
  height: 160px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.label-preview-item .lp-name {
  font-size: 11px;
  font-weight: 600;
  color: #1f2937;
  text-align: center;
  line-height: 1.3;
  word-break: break-all;
  max-height: 28px;
  overflow: hidden;
}

.label-preview-item .lp-barcode {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.label-preview-item .lp-barcode canvas {
  max-width: 100%;
  max-height: 70px;
}

.label-preview-item .lp-footer {
  font-size: 8px;
  color: #6b7280;
  text-align: center;
  font-family: monospace;
}

.label-preview-item .lp-points {
  font-size: 10px;
  color: #ff69b4;
  font-weight: 600;
}

/* 商品列表中的商品图片缩略图 */
.table-product-img {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
}

/* Two column layout */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* Member specific */
.member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff69b4, #ffb6c1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}
.member-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.member-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.member-name {
  font-weight: 500;
  color: #1f2937;
}

.member-sub {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 2px;
}

/* Banner / notice */
.notice-bar {
  background: linear-gradient(90deg, #fff5f8, #ffe8f0);
  border: 1px solid #ffd6e4;
  border-radius: 10px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #9d174d;
  font-size: 13px;
  margin-bottom: 20px;
}

.notice-bar-icon {
  font-size: 18px;
}

/* Points specific */
.points-balance {
  background: linear-gradient(135deg, #fff5f8, #ffe8f0);
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.points-balance-label {
  font-size: 13px;
  color: #9d174d;
  margin-bottom: 6px;
}

.points-balance-value {
  font-size: 28px;
  font-weight: 700;
  color: #ff69b4;
}

.points-balance-user {
  color: #6b7280;
  font-size: 13px;
}

/* Quick actions */
.quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.quick-action-btn {
  padding: 8px 14px;
  border-radius: 8px;
  background: #fff5f8;
  color: #ff69b4;
  font-size: 13px;
  transition: all 0.15s;
}

.quick-action-btn:hover {
  background: #ffe8f0;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #9ca3af;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 14px;
}

/* Responsive */
@media (max-width: 1400px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-grid,
  .form-grid-3,
  .two-col {
    grid-template-columns: 1fr;
  }
}

@media print {
  .sidebar,
  .topbar,
  .toolbar,
  .pagination,
  .no-print {
    display: none !important;
  }
  .main {
    margin-left: 0;
  }
  body {
    background: #fff;
  }
}
