/* =============================================
   酸奶订购系统 - 后台管理全局样式
   ============================================= */

/* ==================== 全局重置 ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: #333;
  background: #f5f7fa;
}

/* ==================== 布局样式 ==================== */
.layout-sidebar {
  display: flex;
  min-height: 100vh;
}

.layout-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* ==================== 侧边栏 ==================== */
.sidebar {
  width: 250px;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  padding: 20px;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
}

.sidebar .logo {
  font-size: 18px;
  font-weight: bold;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 20px;
}

.sidebar .logo span {
  margin-right: 8px;
}

.sidebar .menu {
  list-style: none;
  padding-left: 0;
}

.sidebar .menu li {
  margin-bottom: 8px;
}

.sidebar .menu li a {
  display: block;
  padding: 12px 16px;
  color: #b8c5d6;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.3s, color 0.3s;
}

.sidebar .menu li a:hover,
.sidebar .menu li a.active {
  background: rgba(102, 126, 234, 0.2);
  color: #fff;
}

.sidebar .menu li a span {
  margin-right: 10px;
}

.sidebar .menu-group {
  margin-bottom: 4px;
}

.sidebar .menu-group-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: #b8c5d6;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.3s, color 0.3s;
}

.sidebar .menu-group-header:hover {
  background: rgba(102, 126, 234, 0.15);
  color: #fff;
}

.sidebar .menu-group-header.open {
  background: rgba(102, 126, 234, 0.2);
  color: #fff;
}

.sidebar .menu-group-icon {
  margin-right: 10px;
  font-size: 16px;
}

.sidebar .menu-group-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.sidebar .menu-group-arrow {
  font-size: 12px;
  transition: transform 0.3s;
}

.sidebar .menu-group-header.open .menu-group-arrow {
  transform: rotate(0deg);
}

.sidebar .menu-group-items {
  list-style: none;
  padding-left: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

.sidebar .menu-group-items.open {
  max-height: 500px;
  opacity: 1;
}

.sidebar .menu-group-items li {
  padding-left: 20px;
}

.sidebar .menu-group-items li a {
  padding: 10px 16px;
  padding-left: 44px;
  font-size: 13px;
  border-radius: 0 8px 8px 0;
}

.sidebar .menu-group-items li a:hover,
.sidebar .menu-group-items li a.active {
  background: rgba(102, 126, 234, 0.15);
}

.sidebar .user-info {
  position: absolute;
  bottom: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  width: calc(100% - 40px);
}

.sidebar .user-info .name {
  font-size: 14px;
  margin-bottom: 4px;
}

.sidebar .user-info .role {
  font-size: 12px;
  color: #8892a6;
}

.sidebar .user-info .logout {
  margin-top: 12px;
  padding: 8px 16px;
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  text-align: center;
  transition: background 0.3s;
}

.sidebar .user-info .logout:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* ==================== 主内容区 ==================== */
.main-content {
  flex: 1;
  margin-left: 250px;
  padding: 20px;
}

/* ==================== 头部 ==================== */
.header {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h2 {
  font-size: 20px;
  color: #333;
}

.header .date {
  color: #999;
  font-size: 14px;
}

.header .actions {
  display: flex;
  gap: 12px;
}

/* ==================== 按钮 ==================== */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
  background: #f1f5f9;
  color: #64748b;
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-danger {
  background: #ef4444;
  color: #fff;
}

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

.btn-success {
  background: #10b981;
  color: #fff;
}

.btn-success:hover {
  background: #059669;
}

.btn-warning {
  background: #f59e0b;
  color: #fff;
}

.btn-warning:hover {
  background: #d97706;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
  margin-right: 8px;
}

.btn-sm:last-child {
  margin-right: 0;
}

/* ==================== 卡片 ==================== */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 24px;
}

.card-tip {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  padding: 12px 16px;
  margin-bottom: 20px;
  border-radius: 0 8px 8px 0;
  font-size: 14px;
  color: #92400e;
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.grid-item {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  padding: 24px;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
}

.grid-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

.grid-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.grid-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.grid-desc {
  font-size: 14px;
  opacity: 0.85;
  margin-bottom: 16px;
}

.grid-arrow {
  font-size: 24px;
  align-self: flex-end;
  opacity: 0.7;
}

.brand-ad-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 10px;
  min-height: 200px;
}

.brand-ad-item {
  aspect-ratio: 1;
  border: 2px dashed #ddd;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: all 0.3s;
  background-color: #fafafa;
}

.brand-ad-item:hover {
  border-color: #1890ff;
}

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

.brand-ad-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.3s;
}

.brand-ad-item:hover .brand-ad-overlay {
  opacity: 1;
}

.brand-ad-empty {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: #999;
  font-size: 14px;
  background-color: #fafafa;
  border-radius: 8px;
  border: 2px dashed #eee;
}

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

.info-card {
  background: linear-gradient(135deg, #e6f7ff 0%, #f0f5ff 100%);
  border-radius: 12px;
  border-left: 4px solid #1890ff;
  padding: 20px;
  margin-bottom: 20px;
}

.info-card h3 {
  color: #1890ff;
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 16px;
}

.info-card p {
  color: #595959;
  margin: 8px 0;
  font-size: 13px;
  line-height: 1.6;
}

.info-card ul {
  margin: 10px 0;
  padding-left: 20px;
}

.info-card li {
  color: #595959;
  margin: 6px 0;
  font-size: 13px;
  line-height: 1.5;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 16px;
}

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

/* ==================== 统计卡片 ==================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.stat-card {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.stat-card .icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.stat-card .value {
  font-size: 28px;
  font-weight: bold;
  color: #333;
  margin-bottom: 4px;
}

.stat-card .label {
  color: #999;
  font-size: 14px;
}

.stat-card.orange { border-left: 4px solid #f59e0b; }
.stat-card.blue { border-left: 4px solid #3b82f6; }
.stat-card.green { border-left: 4px solid #10b981; }
.stat-card.purple { border-left: 4px solid #8b5cf6; }
.stat-card.red { border-left: 4px solid #ef4444; }
.stat-card.cyan { border-left: 4px solid #06b6d4; }

/* ==================== 表格 ==================== */
.table-container {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}

th {
  background: #f8fafc;
  font-weight: 600;
  color: #64748b;
  font-size: 13px;
}

td {
  font-size: 14px;
  color: #334155;
}

.table-hover tbody tr:hover {
  background: #f8fafc;
}

.table-empty {
  text-align: center;
  color: #999;
  padding: 40px 0;
}

/* ==================== 状态标签 ==================== */
.status {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.status.active { background: #d1fae5; color: #059669; }
.status.inactive { background: #fee2e2; color: #dc2626; }
.status.pending { background: #fef3c7; color: #d97706; }
.status.confirmed { background: #dbeafe; color: #2563eb; }
.status.delivering { background: #d1fae5; color: #059669; }
.status.delivered { background: #ede9fe; color: #7c3aed; }
.status.completed { background: #f3f4f6; color: #6b7280; }

/* ==================== 奖励类型标签 ==================== */
.reward-type {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.reward-type.early { background: #fef3c7; color: #d97706; }
.reward-type.personal { background: #dbeafe; color: #2563eb; }
.reward-type.referral { background: #d1fae5; color: #059669; }
.reward-type.monthly { background: #ede9fe; color: #7c3aed; }
.reward-type.team { background: #fce7f3; color: #db2777; }
.reward-type.provincial { background: #f3f4f6; color: #6b7280; }

/* ==================== 等级标签 ==================== */
.level-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.level-badge-0 { background-color: #E4E7ED; color: #606266; }
.level-badge-1 { background-color: #F0F9FF; color: #409EFF; }
.level-badge-2 { background-color: #F0FFF4; color: #67C23A; }
.level-badge-3 { background-color: #FFF7E6; color: #E6A23C; }
.level-badge-4 { background-color: #F5F7FA; color: #909399; }
.level-badge-5 { background-color: #FFFBE6; color: #E6A23C; }

/* ==================== Tab切换 ==================== */
.tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.tab {
  padding: 10px 20px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
}

.tab:hover {
  border-color: #667eea;
  color: #667eea;
}

.tab.active {
  background: #667eea;
  color: #fff;
  border-color: #667eea;
}

/* ==================== 模态框 ==================== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 30px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h3 {
  margin-bottom: 20px;
  color: #333;
  font-size: 18px;
}

.modal-header {
  background-color: #F5F7FA;
  border-bottom: none;
  padding: 16px 20px;
  border-radius: 12px 12px 0 0;
}

.modal-title {
  font-weight: 600;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ==================== 表单 ==================== */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: #333;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-group .checkbox-group {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
}

.form-group .checkbox-item {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.form-group .checkbox-item span {
  white-space: nowrap;
}

.form-hint {
  margin-top: 8px;
  font-size: 12px;
  color: #999;
  line-height: 1.5;
}

/* ==================== 筛选栏 ==================== */
.filter-bar {
  background: #fff;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 20px;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-bar input,
.filter-bar select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

.filter-bar input {
  width: 200px;
}

/* ==================== 筛选区域 ==================== */
.main-content .filter-section {
  background: #ffffff !important;
  padding: 24px !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
  margin-bottom: 20px !important;
  display: block !important;
}

.main-content .filter-section .filter-row {
  display: flex !important;
  gap: 24px !important;
  align-items: flex-end !important;
  flex-wrap: wrap !important;
  flex-direction: row !important;
}

.main-content .filter-section .filter-row .filter-item {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  margin-bottom: 0 !important;
}

.main-content .filter-section .filter-row .filter-item label {
  font-size: 13px !important;
  color: #64748b !important;
  font-weight: 500 !important;
  margin-bottom: 4px !important;
  display: block !important;
}

.main-content .filter-section .filter-row .filter-item input,
.main-content .filter-section .filter-row .filter-item select {
  padding: 10px 14px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  min-width: 170px !important;
  transition: all 0.3s !important;
  background: #ffffff !important;
  display: block !important;
  height: auto !important;
}

.main-content .filter-section .filter-row .filter-item input:focus,
.main-content .filter-section .filter-row .filter-item select:focus {
  outline: none !important;
  border-color: #667eea !important;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
}

.main-content .filter-section .filter-row .filter-item input[type="date"] {
  min-width: 190px !important;
}

.main-content .filter-section .filter-row .filter-item input[type="number"] {
  min-width: 150px !important;
}

.main-content .filter-section .filter-row .filter-item button {
  padding: 10px 24px !important;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.3s !important;
  height: 38px !important;
  align-self: flex-end !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.main-content .filter-section .filter-row .filter-item button:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35) !important;
}

/* ==================== 搜索框 ==================== */
.search-input {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  width: 200px;
}

/* ==================== 快捷操作 ==================== */
.quick-actions {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.quick-actions h3 {
  margin-bottom: 16px;
  color: #333;
}

.action-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.action-btn {
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-btn:hover {
  background: #667eea;
  border-color: #667eea;
  color: #fff;
}

.action-btn span {
  margin-right: 8px;
}

/* ==================== 分页 ==================== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 20px;
}

.pagination button {
  padding: 8px 16px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
}

.pagination button:hover {
  border-color: #667eea;
  color: #667eea;
}

.pagination button.active {
  background: #667eea;
  color: #fff;
  border-color: #667eea;
}

/* ==================== 警告提示 ==================== */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.alert-warning {
  background: #fffbeb;
  color: #92400e;
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
}

.alert-success {
  background: #ecfdf5;
  color: #065f46;
}

/* ==================== 订单卡片 ==================== */
.order-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 16px;
  overflow: hidden;
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.order-card-header .order-no {
  font-weight: 600;
  font-size: 15px;
}

.order-card-header .order-date {
  font-size: 13px;
  opacity: 0.9;
}

.order-item {
  display: flex;
  gap: 12px;
  background: #f8fafc;
  border-radius: 8px;
  padding: 10px;
  min-width: 200px;
  max-width: 300px;
}

.item-image {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
  background: #e2e8f0;
  flex-shrink: 0;
}

.item-info {
  flex: 1;
  min-width: 0;
}

.item-name {
  font-weight: 500;
  font-size: 14px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.item-spec {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
}

.item-price {
  font-size: 13px;
  color: #ef4444;
  font-weight: 500;
}

.order-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
  font-size: 13px;
}

.order-info .info-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-info .info-label {
  color: #94a3b8;
  font-weight: 500;
}

.order-info .info-value {
  color: #334155;
}

.order-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.order-total {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.order-total-label {
  color: #64748b;
  font-size: 14px;
}

.order-total-amount {
  font-size: 20px;
  font-weight: 700;
  color: #ef4444;
}

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

.status.closed {
  background: #f3f4f6;
  color: #6b7280;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

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

.reward-card .title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.reward-card .desc {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 16px;
}

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

.reward-card .btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
}

.reward-card.purple { border-left: 4px solid #9b59b6; }
.reward-card.blue { border-left: 4px solid #3498db; }
.reward-card.green { border-left: 4px solid #2ecc71; }
.reward-card.orange { border-left: 4px solid #f39c12; }
.reward-card.red { border-left: 4px solid #e74c3c; }
.reward-card.cyan { border-left: 4px solid #1abc9c; }
.reward-card.pink { border-left: 4px solid #e91e63; }
.reward-card.gray { border-left: 4px solid #666; }
.reward-card.dark-blue { border-left: 4px solid #2c3e50; }

.stat-link {
    margin-top: 8px;
    color: #3498db;
    cursor: pointer;
    font-size: 13px;
}
.stat-link:hover {
    text-decoration: underline;
}

.order-card-body {
  padding: 16px 20px;
}

.order-card-footer {
  padding: 12px 20px;
  background: #f8fafc;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.order-items {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.order-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 8px;
}

.order-item-image {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
}

/* ==================== 商品图片 ==================== */
.goods-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
}

.goods-image-sm {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
}

/* ==================== Bootstrap 兼容样式 ==================== */
.btn-primary.bootstrap {
  background-color: #409EFF;
  border-color: #409EFF;
}

.btn-primary.bootstrap:hover {
  background-color: #66B1FF;
  border-color: #66B1FF;
}

.form-control:focus {
  box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
  border-color: #409EFF;
}

.table th,
.table td {
  vertical-align: middle;
}

.badge {
  font-size: 12px;
  padding: 4px 8px;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }

  .main-content {
    margin-left: 0;
  }

  .sidebar .user-info {
    position: relative;
    bottom: auto;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar input {
    width: 100%;
  }
}

/* ==================== 规格模板样式 ==================== */
.template-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
  padding: 20px 0;
}

.template-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  background: white;
  transition: all 0.3s;
}

.template-card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.template-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
}

.template-name {
  font-size: 18px;
  font-weight: bold;
  color: #333;
}

.template-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 15px;
}

.info-item {
  display: flex;
  flex-direction: column;
}

.info-label {
  font-size: 12px;
  color: #999;
  margin-bottom: 4px;
}

.info-value {
  font-size: 14px;
  color: #333;
  font-weight: 500;
}

.template-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.price-tag {
  font-size: 24px;
  color: #ff6b00;
  font-weight: bold;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

/* ==================== 奖励管理样式 ==================== */
.reward-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.reward-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.reward-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.reward-card .icon {
  font-size: 36px;
  margin-bottom: 12px;
}

/* ==================== 区域管理样式 ==================== */
.header-actions {
  display: flex;
  gap: 10px;
}

.province-form {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.province-form input {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.province-form input[type="text"] {
  flex: 1;
  min-width: 120px;
}

.province-form input[type="number"] {
  width: 80px;
}

.province-list {
  border: 1px solid #eee;
  border-radius: 4px;
}

.province-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 15px;
  border-bottom: 1px solid #eee;
}

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

.province-item .province-name {
  font-weight: 500;
  min-width: 120px;
}

.province-item .province-code {
  color: #666;
  min-width: 100px;
}

.province-item .province-sort {
  color: #999;
  font-size: 12px;
}

.province-item button {
  margin-left: auto;
}

#province-modal .modal-body {
  max-height: 70vh;
  overflow-y: auto;
}

.province-form input::-webkit-search-cancel-button,
.province-form input::-ms-clear {
  display: none;
}

/* ==================== 排名页面样式 ==================== */
.activity-info {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
}

.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-item label {
  font-weight: 500;
  color: #666;
}

.search-item select,
.search-item input {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.search-item button {
  padding: 8px 20px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.search-item button:hover {
  background: #0056b3;
}

.loading {
  text-align: center;
  padding: 40px;
  color: #666;
}

.empty {
  text-align: center;
  padding: 40px;
  color: #999;
}

/* ==================== 财务模块样式 ==================== */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.detail-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin-bottom: 16px;
  padding: 20px;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
}

.order-no {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.stat-card.gradient {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.stat-card.gradient .value {
  color: #fff;
}

.stat-card.gradient .label {
  color: rgba(255,255,255,0.8);
}

.chart-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 20px;
  margin-bottom: 16px;
}

.chart-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #333;
}

.monthly-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

/* ==================== 转介绍管理样式 ==================== */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.data-table th {
  background: #f8f9fa;
  font-weight: 600;
  color: #666;
}

.data-table tr:hover {
  background: #f8f9fa;
}

.referral-count {
  background: #10b981;
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
}

.view-btn {
  padding: 4px 12px;
  background: #1890ff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show {
  display: flex;
}

.modal-overlay .modal {
  background: white;
  border-radius: 8px;
  width: 90%;
  max-width: 700px;
  max-height: 80vh;
  overflow: hidden;
}

.modal-overlay .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #ddd;
  background: none;
}

.modal-overlay .modal-title {
  font-size: 18px;
  font-weight: 600;
}

.modal-overlay .modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  font-size: 24px;
  cursor: pointer;
}

.modal-overlay .modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(80vh - 80px);
}

.referral-table {
  width: 100%;
  border-collapse: collapse;
}

.referral-table th,
.referral-table td {
  padding: 10px;
  border: 1px solid #ddd;
}

.referral-table th {
  background: #f5f5f5;
}

.rank-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #6c757d;
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.rank-num.top1 { background: #ffc107; }
.rank-num.top2 { background: #6c757d; }
.rank-num.top3 { background: #dc7633; }

.badge-primary { background: #cce5ff; color: #004085; }
.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }

.level-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  padding: 12px 16px;
  background: #f8f9fa;
  border-radius: 8px;
}

.level-label {
  font-weight: 500;
  color: #666;
}

.level-btn {
  padding: 8px 16px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.level-btn:hover {
  border-color: #007bff;
  color: #007bff;
}

.level-btn.active {
  background: #007bff;
  color: white;
  border-color: #007bff;
}

.status-pending { background: #fef3c7; color: #d97706; }
.status-completed { background: #d1fae5; color: #059669; }

.order-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.order-table th,
.order-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}

.order-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #64748b;
}

.order-table tr:hover {
  background: #f8fafc;
}

.amount {
  font-weight: 600;
  color: #e53e3e;
}

.image-upload-area {
  border: 2px dashed #ddd;
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.image-upload-area:hover {
  border-color: #1890ff;
  background-color: #f5f7fa;
}

.image-upload-area.dragover {
  border-color: #1890ff;
  background-color: #e6f7ff;
}

.upload-area {
  border: 2px dashed #ddd;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.upload-area:hover {
  border-color: #1890ff;
  background-color: #f5f7fa;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #999;
}

.image-preview {
  max-width: 150px;
  max-height: 150px;
  object-fit: cover;
  border-radius: 4px;
}

.upload-btn {
  display: inline-block;
  padding: 8px 16px;
  background: #1890ff;
  color: white;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 10px;
}

.upload-btn:hover {
  background: #40a9ff;
}

.remove-image {
  display: block;
  margin-top: 10px;
  color: #ff4d4f;
  cursor: pointer;
  font-size: 12px;
}

.rich-editor {
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  min-height: 200px;
  padding: 10px;
  outline: none;
  font-size: 14px;
  line-height: 1.5;
}

.rich-editor:focus {
  border-color: #1890ff;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.info-row {
  display: flex;
  gap: 40px;
  margin-bottom: 12px;
}

.info-row .info-label {
  color: #64748b;
  width: 100px;
}

.audit-detail-container {
  padding: 5px 0;
}

.audit-detail-container .detail-section {
  background: #f8fafc;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.audit-detail-container .detail-section:last-child {
  margin-bottom: 0;
}

.audit-detail-container .section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.audit-detail-container .title-icon {
  font-size: 18px;
}

.audit-detail-container .info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.audit-detail-container .info-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 0;
}

.audit-detail-container .info-row label {
  font-size: 14px;
  color: #64748b;
  min-width: 90px;
  flex-shrink: 0;
}

.audit-detail-container .info-row .value {
  font-size: 14px;
  color: #1e293b;
  font-weight: 500;
}

.audit-detail-container .status-card {
  background: #ffffff;
  border-radius: 10px;
  padding: 16px;
  border: 1px solid #e2e8f0;
}

.audit-detail-container .status-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
}

.info-row .info-value {
  color: #333;
}

.goods-list {
  margin-top: 16px;
}

.goods-item {
  display: flex;
  gap: 16px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
  margin-bottom: 10px;
}

.goods-image-lg {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  background: #e2e8f0;
}

.goods-info {
  flex: 1;
}

.goods-name {
  font-weight: 500;
  margin-bottom: 4px;
}

.goods-spec {
  color: #64748b;
  font-size: 14px;
  margin-bottom: 8px;
}

.goods-price {
  color: #e53e3e;
  font-weight: 600;
}

.total-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}

.total-label {
  font-size: 16px;
  font-weight: 500;
}

.total-value {
  font-size: 24px;
  font-weight: 700;
  color: #e53e3e;
}

.action-bar {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.menu-item {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: all 0.2s;
}

.menu-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.menu-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.menu-text {
  font-size: 14px;
  color: #333;
  font-weight: 500;
}

.month-item {
  text-align: center;
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
}

.month-name {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 8px;
}

.month-amount {
  font-size: 20px;
  font-weight: 700;
  color: #667eea;
}

.category-list {
  list-style: none;
  padding: 0;
}

.category-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}

.category-name {
  color: #333;
}

.category-amount {
  font-weight: 600;
  color: #e53e3e;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 8px;
  color: #fff;
  margin-top: 16px;
}

.summary-label {
  font-size: 14px;
  opacity: 0.9;
}

.summary-value {
  font-size: 24px;
  font-weight: 700;
}

.editor-toolbar {
  border: 1px solid #d9d9d9;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  padding: 8px;
  background: #fafafa;
}

.toolbar-btn {
  display: inline-block;
  width: 28px;
  height: 28px;
  line-height: 26px;
  text-align: center;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  cursor: pointer;
  margin-right: 4px;
  font-size: 14px;
}

.toolbar-btn:hover {
  background: #e6f7ff;
  border-color: #1890ff;
}

#image-file {
  display: none;
}

.spec-template-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.spec-template-card {
  border: 2px solid #e8e8e8;
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.3s;
  background: white;
  position: relative;
}

.spec-template-card:hover {
  border-color: #1890ff;
  background: #f5f7fa;
}

.spec-template-card.selected {
  border-color: #1890ff;
  background: #e6f7ff;
}

.spec-template-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.spec-template-name {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.spec-template-price {
  font-size: 18px;
  font-weight: bold;
  color: #ff6b00;
}

.spec-template-specs {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
}

.spec-template-specs span {
  display: block;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }

  .main-content {
    margin-left: 0;
  }

  .sidebar .user-info {
    position: relative;
    bottom: auto;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar input {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .tabs {
    flex-wrap: wrap;
  }
}