/* ============================================
 * 七月仁禾后台管理系统 - 全局样式
 * 主题色：主色#C75C2E（暖橙红）、辅色#5A8A5E（稻绿）、背景#F9F7F2
 * ============================================ */

/* CSS变量定义 */
:root {
  --primary: #C75C2E;
  --primary-light: #E8A87C;
  --primary-dark: #A04823;
  --secondary: #5A8A5E;
  --secondary-light: #7DB881;
  --secondary-dark: #3E6B42;
  --bg: #F9F7F2;
  --bg-white: #FFFFFF;
  --bg-gray: #F3F1EC;
  --border: #E5E0D5;
  --border-light: #EDE9E0;
  --text-primary: #2D2A26;
  --text-secondary: #6B6560;
  --text-muted: #A09A92;
  --success: #5A8A5E;
  --warning: #D4A24E;
  --danger: #C75C2E;
  --info: #5B8DB8;
  --shadow-sm: 0 1px 3px rgba(45, 42, 38, 0.08);
  --shadow-md: 0 4px 12px rgba(45, 42, 38, 0.1);
  --shadow-lg: 0 8px 24px rgba(45, 42, 38, 0.12);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --sidebar-width: 240px;
  --header-height: 60px;
  --transition: all 0.3s ease;
}

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

html, body {
  height: 100%;
  font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  vertical-align: middle;
}

input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
}

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

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-gray);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ============================================
 * 登录页样式
 * ============================================ */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #F9F7F2 0%, #EDE9E0 50%, #E8E2D8 100%);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(199, 92, 46, 0.08) 0%, transparent 70%);
}

.login-page::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(90, 138, 94, 0.06) 0%, transparent 70%);
}

.login-container {
  width: 420px;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

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

.login-logo img {
  width: 80px;
  height: 80px;
}

.login-logo h1 {
  font-size: 24px;
  color: var(--primary);
  margin-top: 12px;
  font-weight: 600;
}

.login-logo p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

/* ============================================
 * 布局样式 - 侧边栏 + 主内容区
 * ============================================ */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #2D2A26 0%, #3D3830 100%);
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  overflow-y: auto;
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.sidebar-header img {
  width: 36px;
  height: 36px;
}

.sidebar-header .brand-name {
  font-size: 16px;
  font-weight: 600;
  margin-left: 10px;
  color: #fff;
}

.sidebar-header .brand-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin-left: 10px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

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

.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
  border-left: 3px solid transparent;
  text-decoration: none;
}

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

.sidebar-nav .nav-item.active {
  background: rgba(199, 92, 46, 0.15);
  color: var(--primary-light);
  border-left-color: var(--primary);
}

.sidebar-nav .nav-item .nav-icon {
  width: 20px;
  text-align: center;
  margin-right: 10px;
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar-nav .nav-item .nav-text {
  flex: 1;
}

.sidebar-nav .nav-item .nav-arrow {
  font-size: 12px;
  transition: var(--transition);
}

.sidebar-nav .nav-item .nav-arrow.expanded {
  transform: rotate(90deg);
}

/* 子菜单 */
.sidebar-nav .sub-menu {
  display: none;
  background: rgba(0, 0, 0, 0.15);
}

.sidebar-nav .sub-menu.show {
  display: block;
}

.sidebar-nav .sub-menu .nav-item {
  padding-left: 50px;
  font-size: 13px;
}

.sidebar-nav .sub-menu .nav-item.active {
  background: rgba(199, 92, 46, 0.2);
}

/* 侧边栏底部 */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.sidebar-footer .user-info {
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.sidebar-footer .user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  margin-right: 8px;
  flex-shrink: 0;
}

.sidebar-footer .logout-btn {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.sidebar-footer .logout-btn:hover {
  color: #fff;
  background: rgba(199, 92, 46, 0.3);
}

/* 主内容区 */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 顶部导航栏 */
.top-header {
  height: var(--header-height);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.top-header .breadcrumb {
  font-size: 14px;
  color: var(--text-muted);
}

.top-header .breadcrumb span {
  color: var(--text-primary);
  font-weight: 500;
}

.top-header .header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.top-header .header-actions .notification-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
  position: relative;
  background: none;
  border: none;
  font-size: 18px;
}

.top-header .header-actions .notification-btn:hover {
  background: var(--bg-gray);
  color: var(--primary);
}

.top-header .header-actions .notification-btn .badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-white);
}

/* 页面内容区 */
.page-content {
  flex: 1;
  padding: 24px;
}

/* ============================================
 * 页面标题区
 * ============================================ */
.page-header {
  margin-bottom: 24px;
}

.page-header .page-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.page-header .page-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.page-header .page-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

/* ============================================
 * 卡片样式
 * ============================================ */
.card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 20px;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header .card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  padding: 20px;
}

.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-gray);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* ============================================
 * 统计卡片
 * ============================================ */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: var(--transition);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 12px;
}

.stat-card .stat-icon.orange {
  background: rgba(199, 92, 46, 0.1);
  color: var(--primary);
}

.stat-card .stat-icon.green {
  background: rgba(90, 138, 94, 0.1);
  color: var(--secondary);
}

.stat-card .stat-icon.blue {
  background: rgba(91, 141, 184, 0.1);
  color: var(--info);
}

.stat-card .stat-icon.yellow {
  background: rgba(212, 162, 78, 0.1);
  color: var(--warning);
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.stat-card .stat-trend {
  font-size: 12px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-card .stat-trend.up {
  color: var(--success);
}

.stat-card .stat-trend.down {
  color: var(--danger);
}

/* ============================================
 * 按钮样式
 * ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  gap: 6px;
  text-decoration: none;
  line-height: 1.5;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-success {
  background: var(--secondary);
  color: #fff;
  border-color: var(--secondary);
}

.btn-success:hover {
  background: var(--secondary-dark);
  border-color: var(--secondary-dark);
}

.btn-warning {
  background: var(--warning);
  color: #fff;
  border-color: var(--warning);
}

.btn-warning:hover {
  background: #C4922E;
  border-color: #C4922E;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn-danger:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-outline {
  background: var(--bg-white);
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-text {
  background: transparent;
  color: var(--primary);
  border: none;
  padding: 4px 8px;
}

.btn-text:hover {
  background: rgba(199, 92, 46, 0.06);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

.btn-lg {
  padding: 12px 28px;
  font-size: 16px;
}

.btn-block {
  display: flex;
  width: 100%;
}

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

.btn .btn-icon {
  font-size: 16px;
}

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

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-white);
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(199, 92, 46, 0.1);
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-control:disabled,
.form-control[readonly] {
  background: var(--bg-gray);
  cursor: not-allowed;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23A09A92' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

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

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
}

/* 搜索表单 */
.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-bar .search-input {
  width: 280px;
  position: relative;
}

.search-bar .search-input input {
  padding-left: 36px;
}

.search-bar .search-input .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

/* ============================================
 * 表格样式
 * ============================================ */
.table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  font-size: 14px;
}

.data-table thead th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-gray);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  font-size: 13px;
}

.data-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: rgba(199, 92, 46, 0.02);
}

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

/* 表格内操作按钮组 */
.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================
 * 分页样式
 * ============================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  font-size: 13px;
  color: var(--text-muted);
}

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

.pagination .page-sizes select {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-white);
  outline: none;
}

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

.pagination .page-btns .page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-white);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: var(--transition);
}

.pagination .page-btns .page-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pagination .page-btns .page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.pagination .page-btns .page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================
 * 标签/徽章样式
 * ============================================ */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.tag-primary {
  background: rgba(199, 92, 46, 0.1);
  color: var(--primary);
}

.tag-success {
  background: rgba(90, 138, 94, 0.1);
  color: var(--secondary);
}

.tag-warning {
  background: rgba(212, 162, 78, 0.1);
  color: var(--warning);
}

.tag-danger {
  background: rgba(199, 92, 46, 0.1);
  color: var(--danger);
}

.tag-info {
  background: rgba(91, 141, 184, 0.1);
  color: var(--info);
}

.tag-default {
  background: var(--bg-gray);
  color: var(--text-muted);
}

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

.status-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-tag.pending {
  background: rgba(212, 162, 78, 0.1);
  color: var(--warning);
}

.status-tag.pending::before {
  background: var(--warning);
}

.status-tag.accepted {
  background: rgba(91, 141, 184, 0.1);
  color: var(--info);
}

.status-tag.accepted::before {
  background: var(--info);
}

.status-tag.preparing {
  background: rgba(199, 92, 46, 0.1);
  color: var(--primary);
}

.status-tag.preparing::before {
  background: var(--primary);
}

.status-tag.completed {
  background: rgba(90, 138, 94, 0.1);
  color: var(--secondary);
}

.status-tag.completed::before {
  background: var(--secondary);
}

.status-tag.cancelled {
  background: rgba(199, 92, 46, 0.06);
  color: var(--text-muted);
}

.status-tag.cancelled::before {
  background: var(--text-muted);
}

/* ============================================
 * 标签页样式
 * ============================================ */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 20px;
}

.tabs .tab-item {
  padding: 10px 24px;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  font-weight: 500;
}

.tabs .tab-item:hover {
  color: var(--primary);
}

.tabs .tab-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tabs .tab-item .tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--danger);
  color: #fff;
  border-radius: 10px;
  font-size: 11px;
  margin-left: 6px;
}

/* ============================================
 * 弹窗/模态框样式
 * ============================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.modal {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  width: 560px;
  max-width: 90vw;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.modal-overlay.show .modal {
  transform: translateY(0);
}

.modal-lg {
  width: 780px;
}

.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header .modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-header .modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
  background: none;
  border: none;
  font-size: 18px;
}

.modal-header .modal-close:hover {
  background: var(--bg-gray);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(85vh - 130px);
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: var(--bg-gray);
}

/* ============================================
 * 文件上传区域
 * ============================================ */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg);
  position: relative;
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--primary);
  background: rgba(199, 92, 46, 0.04);
}

.upload-area .upload-icon {
  font-size: 40px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.upload-area .upload-text {
  font-size: 14px;
  color: var(--text-secondary);
}

.upload-area .upload-text .upload-link {
  color: var(--primary);
  font-weight: 500;
}

.upload-area .upload-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

.upload-area input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* 上传预览列表 */
.upload-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.upload-preview-item {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

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

.upload-preview-item .preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  border: none;
  transition: var(--transition);
}

.upload-preview-item .preview-remove:hover {
  background: var(--danger);
}

.upload-preview-item .preview-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-preview-item .preview-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--primary);
  transition: width 0.3s;
}

/* ============================================
 * 空状态
 * ============================================ */
.empty-state {
  padding: 60px 20px;
  text-align: center;
}

.empty-state .empty-icon {
  font-size: 64px;
  color: var(--border);
  margin-bottom: 16px;
}

.empty-state .empty-text {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ============================================
 * 加载动画
 * ============================================ */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}

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

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 页面内加载 */
.page-loading {
  text-align: center;
  padding: 40px;
}

.page-loading .loading-spinner {
  margin: 0 auto 16px;
}

.page-loading p {
  color: var(--text-muted);
  font-size: 13px;
}

/* ============================================
 * 消息提示（Toast）
 * ============================================ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-white);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  color: var(--text-primary);
  min-width: 280px;
  animation: slideIn 0.3s ease;
  border-left: 4px solid var(--primary);
}

.toast.toast-success {
  border-left-color: var(--success);
}

.toast.toast-error {
  border-left-color: var(--danger);
}

.toast.toast-warning {
  border-left-color: var(--warning);
}

.toast.toast-info {
  border-left-color: var(--info);
}

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

/* ============================================
 * 确认对话框
 * ============================================ */
.confirm-dialog .modal {
  width: 420px;
}

.confirm-dialog .confirm-icon {
  font-size: 48px;
  text-align: center;
  margin-bottom: 16px;
}

.confirm-dialog .confirm-title {
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 8px;
}

.confirm-dialog .confirm-message {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.6;
}

/* ============================================
 * 筛选器样式
 * ============================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-bar .filter-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-bar .filter-item label {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.filter-bar .filter-item select,
.filter-bar .filter-item input {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-white);
  outline: none;
}

.filter-bar .filter-item select {
  min-width: 120px;
}

.filter-bar .filter-item input[type="date"],
.filter-bar .filter-item input[type="number"] {
  width: 150px;
}

/* ============================================
 * 商品图片缩略图
 * ============================================ */
.product-thumb {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-light);
}

/* ============================================
 * 图表容器
 * ============================================ */
.chart-container {
  width: 100%;
  height: 300px;
  position: relative;
}

.chart-canvas {
  width: 100%;
  height: 100%;
}

/* ============================================
 * 规格编辑器
 * ============================================ */
.spec-list {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.spec-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}

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

.spec-item .spec-field {
  flex: 1;
}

.spec-item .spec-field input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
}

.spec-item .spec-field input:focus {
  border-color: var(--primary);
}

.spec-item .spec-remove {
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  border: none;
  background: none;
  transition: var(--transition);
}

.spec-item .spec-remove:hover {
  color: var(--danger);
}

.spec-add-btn {
  padding: 10px;
  text-align: center;
  border: 1px dashed var(--border);
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
  transition: var(--transition);
  border-radius: var(--radius-sm);
  margin-top: 8px;
  background: none;
  width: 100%;
}

.spec-add-btn:hover {
  background: rgba(199, 92, 46, 0.04);
  border-color: var(--primary);
}

/* ============================================
 * 内容管理 - 文章编辑器
 * ============================================ */
.article-editor {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 8px 12px;
  background: var(--bg-gray);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.editor-toolbar button {
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 14px;
  transition: var(--transition);
}

.editor-toolbar button:hover {
  background: var(--bg-white);
  border-color: var(--border);
  color: var(--primary);
}

.editor-toolbar button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.editor-content {
  min-height: 300px;
  padding: 16px;
  outline: none;
  font-size: 14px;
  line-height: 1.8;
}

.editor-content:focus {
  background: rgba(199, 92, 46, 0.01);
}

/* ============================================
 * 核销码输入
 * ============================================ */
.verify-code-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.verify-code-input input {
  width: 140px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  text-align: center;
  letter-spacing: 4px;
  font-weight: 600;
  outline: none;
}

.verify-code-input input:focus {
  border-color: var(--primary);
}

/* ============================================
 * 响应式适配
 * ============================================ */
@media (max-width: 1200px) {
  .stat-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

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

  .stat-cards {
    grid-template-columns: 1fr;
  }

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

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

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

  .form-row {
    flex-direction: column;
  }

  .modal {
    width: 95vw;
  }

  .modal-lg {
    width: 95vw;
  }
}

/* ============================================
 * 工具类
 * ============================================ */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

.mt-0 { margin-top: 0 !important; }
.mt-10 { margin-top: 10px !important; }
.mt-20 { margin-top: 20px !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-10 { margin-bottom: 10px !important; }
.mb-20 { margin-bottom: 20px !important; }

.flex { display: flex !important; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }

.hidden { display: none !important; }
.visible { display: block !important; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 内容管理网格 */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.content-card {
  background: var(--bg-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-light);
  transition: var(--transition);
}

.content-card:hover {
  box-shadow: var(--shadow-md);
}

.content-card .card-thumb {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: var(--bg-gray);
}

.content-card .card-info {
  padding: 12px 16px;
}

.content-card .card-info h4 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-card .card-info p {
  font-size: 12px;
  color: var(--text-muted);
}

.content-card .card-actions {
  padding: 8px 16px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
