/* 后台管理系统样式 */
body {
  background: #F0F2F5;
}

/* ============ 后台布局 ============ */
.admin-shell {
  display: flex;
  min-height: 100vh;
}

.admin-sider {
  width: 220px;
  background: #001529;
  color: rgba(255,255,255,0.85);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin-logo {
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  color: #FFF;
  font-size: 15px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  gap: 10px;
}
.admin-logo-icon {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, #C9A961 0%, #E5C97A 100%);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  color: #001529; font-weight: 700; font-size: 12px;
}

.admin-menu { padding: 8px 0; }
.admin-menu-group {
  padding: 8px 20px 4px;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
}
.admin-menu-item {
  display: flex;
  align-items: center;
  padding: 10px 20px 10px 24px;
  font-size: 13px;
  cursor: pointer;
  color: rgba(255,255,255,0.75);
  border-left: 3px solid transparent;
  gap: 8px;
}
.admin-menu-item:hover { color: #FFF; }
.admin-menu-item.active {
  background: #C9A961;
  color: #001529;
  border-left-color: #E5C97A;
  font-weight: 500;
}
.admin-menu-icon { width: 14px; display: inline-block; text-align: center; }

.admin-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-header {
  height: 56px;
  background: #FFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: 0 1px 4px rgba(0,21,41,0.08);
  position: sticky;
  top: 0;
  z-index: 10;
}
.admin-breadcrumb { font-size: 13px; color: #666; }
.admin-breadcrumb .sep { margin: 0 8px; color: #CCC; }
.admin-breadcrumb .cur { color: #1A1A1A; font-weight: 500; }

.admin-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.admin-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #C9A961 0%, #E5C97A 100%);
  display: flex; align-items: center; justify-content: center;
  color: #001529; font-weight: 600;
}

.admin-body {
  padding: 16px 24px 32px;
  flex: 1;
}

.admin-page-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}
.admin-page-desc { font-size: 12px; color: #888; margin-bottom: 16px; }

/* ============ 通用组件 ============ */
.card {
  background: #FFF;
  border-radius: 6px;
  padding: 16px 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  margin-bottom: 16px;
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title-extra { font-weight: 400; font-size: 12px; color: #888; }

/* 表格 */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  text-align: left;
  padding: 12px;
  background: #FAFAFA;
  border-bottom: 1px solid #EEE;
  color: #555;
  font-weight: 500;
}
.table td {
  padding: 12px;
  border-bottom: 1px solid #F0F0F0;
  vertical-align: middle;
}
.table tr:hover td { background: #FAFAFA; }
.table .actions { display: flex; gap: 8px; }
.table .actions a { color: var(--blue); cursor: pointer; }
.table .actions .danger { color: var(--red); }

/* 表单 */
.form-row {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}
.form-label {
  width: 100px;
  text-align: right;
  font-size: 13px;
  color: #555;
}
.form-label.required::before {
  content: "*";
  color: var(--red);
  margin-right: 4px;
}
.form-input {
  flex: 1;
  max-width: 320px;
  padding: 6px 12px;
  border: 1px solid #DDD;
  border-radius: 4px;
  font-size: 13px;
}
.form-input:focus { border-color: var(--gold); }
textarea.form-input { min-height: 80px; resize: vertical; }
.form-help { font-size: 11px; color: #999; margin-top: 4px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 13px;
  border: 1px solid #DDD;
  background: #FFF;
  color: #555;
  cursor: pointer;
  gap: 4px;
}
.btn:hover { border-color: var(--gold); color: var(--gold); }
.btn-primary {
  background: #C9A961; color: #FFF; border-color: #C9A961;
}
.btn-primary:hover { background: #E5C97A; border-color: #E5C97A; color: #FFF; }
.btn-danger { color: var(--red); border-color: #FFB8B8; }
.btn-danger:hover { background: var(--red); color: #FFF; }
.btn-sm { padding: 2px 10px; font-size: 12px; }
.btn-link { background: transparent; border: 0; color: var(--blue); padding: 0; }

/* 状态标签 */
.status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 11px;
  background: #F0F0F0;
  color: #666;
}
.status-warn { background: #FFF7E6; color: #FA8C16; }
.status-success { background: #F6FFED; color: #52C41A; }
.status-error { background: #FFF1F0; color: #F5222D; }
.status-info { background: #E6F7FF; color: #1890FF; }
.status-gold { background: rgba(201,169,97,0.1); color: #A88A45; }

/* KPI 卡片 */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.kpi-card {
  background: #FFF;
  border-radius: 6px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--gold);
}
.kpi-label { font-size: 12px; color: #888; }
.kpi-value { font-size: 28px; font-weight: 600; margin: 8px 0; color: #1A1A1A; }
.kpi-trend { font-size: 12px; }
.kpi-trend.up { color: #52C41A; }
.kpi-trend.down { color: #F5222D; }

/* 图表占位 */
.chart-placeholder {
  background: linear-gradient(135deg, #FAF8F2 0%, #F4EFE0 100%);
  border: 1px dashed #DDD;
  border-radius: 4px;
  padding: 32px;
  text-align: center;
  color: #888;
  font-size: 12px;
}

/* 筛选条 */
.filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filter-bar .form-input { max-width: 180px; }
.filter-bar select { max-width: 140px; }

/* 分页 */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  font-size: 12px;
  color: #666;
}
.pagination .page-btn {
  padding: 4px 10px;
  border: 1px solid #DDD;
  border-radius: 3px;
  background: #FFF;
  cursor: pointer;
}
.pagination .page-btn.active { background: var(--gold); color: #FFF; border-color: var(--gold); }

/* Tab */
.tabs {
  display: flex;
  border-bottom: 1px solid #EEE;
  margin-bottom: 16px;
  gap: 4px;
}
.tabs .tab {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 13px;
  color: #666;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs .tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  font-weight: 500;
}

/* 日历 */
.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendar .day-header {
  text-align: center;
  font-size: 11px;
  color: #888;
  padding: 4px;
}
.calendar .day {
  background: #FFF;
  border: 1px solid #EEE;
  border-radius: 4px;
  padding: 6px;
  min-height: 64px;
  font-size: 11px;
  cursor: pointer;
  position: relative;
}
.calendar .day:hover { border-color: var(--gold); }
.calendar .day.closed { background: #F5F5F5; color: #BBB; }
.calendar .day.locked::after {
  content: "🔒";
  position: absolute;
  top: 2px; right: 4px;
  font-size: 9px;
}
.calendar .day-num { font-weight: 600; color: #1A1A1A; }
.calendar .day-price { color: var(--gold-dark); margin-top: 4px; }
.calendar .day-stock { color: #888; }
.calendar .day.closed .day-num { color: #BBB; }

/* 弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal {
  background: #FFF;
  border-radius: 6px;
  width: 480px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}
.modal-header {
  padding: 14px 20px;
  border-bottom: 1px solid #F0F0F0;
  font-size: 15px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-close { cursor: pointer; color: #888; }
.modal-body { padding: 20px; font-size: 13px; }
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid #F0F0F0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* 告警级别 */
.alert {
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert-info { background: #E6F7FF; color: #1890FF; }
.alert-warn { background: #FFFBE6; color: #FA8C16; }
.alert-error { background: #FFF1F0; color: #F5222D; }
.alert-dot { width: 6px; height: 6px; border-radius: 50%; }

/* 进度条 */
.progress {
  background: #F0F0F0;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #C9A961, #E5C97A);
  border-radius: 3px;
}

/* 抽屉 */
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 600px;
  max-width: 100vw;
  background: #FFF;
  box-shadow: -4px 0 16px rgba(0,0,0,0.1);
  z-index: 100;
  display: flex;
  flex-direction: column;
}
.drawer-header {
  padding: 14px 20px;
  border-bottom: 1px solid #F0F0F0;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 15px; font-weight: 600;
}
.drawer-body { padding: 20px; flex: 1; overflow-y: auto; }
.drawer-footer {
  padding: 12px 20px;
  border-top: 1px solid #F0F0F0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}