/* 提茶管理后台 - 简约国风设计 */

:root {
  --tea-green: #6B8E5A;
  --tea-green-light: #8BAE7A;
  --tea-green-dark: #4A6B3A;
  --rice-white: #F5F2EA;
  --rice-white-dark: #E8E4D9;
  --ochre: #A67C52;
  --ochre-light: #C49A6E;
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-tertiary: #999999;
  --border-color: #E5E5E5;
  --bg-page: #F5F2EA;
  --bg-card: #FFFFFF;
  --shadow-light: 0 2px 12px rgba(107, 142, 90, 0.08);
  --shadow-medium: 0 4px 20px rgba(107, 142, 90, 0.12);
}

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

body {
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
}

/* 登录页样式 */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6B8E5A 0%, #8BAE7A 50%, #A67C52 100%);
  position: relative;
  overflow: hidden;
}

.login-container::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(5%, 5%); }
}

.login-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 48px 40px;
  width: 420px;
  box-shadow: var(--shadow-medium);
  position: relative;
  z-index: 10;
}

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

.login-logo .logo-icon {
  font-size: 48px;
  color: var(--tea-green);
  margin-bottom: 12px;
}

.login-logo h1 {
  font-size: 28px;
  color: var(--tea-green-dark);
  font-weight: 600;
  letter-spacing: 4px;
  margin-bottom: 8px;
}

.login-logo p {
  color: var(--text-tertiary);
  font-size: 13px;
  letter-spacing: 2px;
}

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

.login-form .form-item label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 14px;
}

.login-btn {
  width: 100%;
  height: 44px;
  background: linear-gradient(135deg, var(--tea-green) 0%, var(--tea-green-dark) 100%);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 8px;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(107, 142, 90, 0.4);
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  color: var(--text-tertiary);
  font-size: 12px;
}

/* 主布局样式 */
.layout-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* 侧边栏 */
.sidebar {
  width: 220px;
  background: linear-gradient(180deg, var(--tea-green-dark) 0%, var(--tea-green) 100%);
  color: white;
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease;
  flex-shrink: 0;
}

.sidebar.collapsed {
  width: 64px;
}

.sidebar-logo {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding: 0 16px;
}

.sidebar-logo .logo-text {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 3px;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar.collapsed .logo-text {
  display: none;
}

.sidebar-logo .logo-icon {
  font-size: 28px;
  margin-right: 8px;
}

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

.menu-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: rgba(255,255,255,0.85);
  border-left: 3px solid transparent;
  white-space: nowrap;
  overflow: hidden;
}

.menu-item:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

.menu-item.active {
  background: rgba(255,255,255,0.15);
  color: white;
  border-left-color: var(--ochre);
}

.menu-item .menu-icon {
  font-size: 18px;
  margin-right: 12px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar.collapsed .menu-item {
  justify-content: center;
  padding: 12px 0;
}

.sidebar.collapsed .menu-item .menu-icon {
  margin-right: 0;
}

.sidebar.collapsed .menu-item .menu-text {
  display: none;
}

/* 主内容区 */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* 顶部导航栏 */
.header {
  height: 60px;
  background: var(--bg-card);
  box-shadow: var(--shadow-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}

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

.toggle-btn {
  cursor: pointer;
  font-size: 20px;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.toggle-btn:hover {
  color: var(--tea-green);
}

.breadcrumb {
  display: flex;
  align-items: center;
  color: var(--text-secondary);
  font-size: 14px;
}

.breadcrumb .separator {
  margin: 0 8px;
  color: var(--text-tertiary);
}

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

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

.admin-info {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.admin-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--tea-green);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
}

.admin-name {
  color: var(--text-primary);
  font-size: 14px;
}

.logout-btn {
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}

.logout-btn:hover {
  color: var(--ochre);
}

/* 内容区域 */
.content-area {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

/* 页面标题 */
.page-header {
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--tea-green);
  border-radius: 2px;
}

/* 卡片样式 */
.card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-light);
  margin-bottom: 20px;
}

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

.stat-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow-light);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.stat-icon.green {
  background: rgba(107, 142, 90, 0.1);
  color: var(--tea-green);
}

.stat-icon.blue {
  background: rgba(64, 158, 255, 0.1);
  color: #409EFF;
}

.stat-icon.orange {
  background: rgba(230, 162, 60, 0.1);
  color: #E6A23C;
}

.stat-icon.purple {
  background: rgba(155, 89, 182, 0.1);
  color: #9B59B6;
}

.stat-info .stat-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.stat-info .stat-label {
  font-size: 13px;
  color: var(--text-tertiary);
}

.stat-info .stat-trend {
  font-size: 12px;
  margin-top: 4px;
}

.stat-trend.up {
  color: var(--tea-green);
}

.stat-trend.down {
  color: #F56C6C;
}

/* 图表区域 */
.chart-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.chart-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-light);
}

.chart-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.chart-container {
  width: 100%;
  height: 300px;
}

/* 搜索筛选栏 */
.filter-bar {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-light);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

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

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

.filter-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

/* 操作栏 */
.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

/* 表格样式覆盖 */
.el-table {
  border-radius: 8px;
  overflow: hidden;
}

.el-table th.el-table__cell {
  background-color: var(--rice-white) !important;
  color: var(--text-primary);
  font-weight: 600;
}

/* 按钮样式覆盖 */
.el-button--primary {
  --el-button-bg-color: var(--tea-green);
  --el-button-border-color: var(--tea-green);
  --el-button-hover-bg-color: var(--tea-green-light);
  --el-button-hover-border-color: var(--tea-green-light);
  --el-button-active-bg-color: var(--tea-green-dark);
  --el-button-active-border-color: var(--tea-green-dark);
}

/* 分页 */
.pagination-container {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

/* 商品图片 */
.product-thumb {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border-color);
}

/* 用户头像 */
.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

/* Banner缩略图 */
.banner-thumb {
  width: 120px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border-color);
}

/* 状态标签 */
.status-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
}

.status-tag.online {
  background: rgba(107, 142, 90, 0.1);
  color: var(--tea-green);
}

.status-tag.offline {
  background: rgba(153, 153, 153, 0.1);
  color: var(--text-tertiary);
}

/* 评分星星 */
.star-rating {
  color: #E6A23C;
}

/* 弹窗表单 */
.dialog-form .form-row {
  margin-bottom: 18px;
}

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

.dialog-form .form-label.required::before {
  content: '*';
  color: #F56C6C;
  margin-right: 4px;
}

/* 上传区域 */
.upload-area {
  width: 120px;
  height: 120px;
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s;
  color: var(--text-tertiary);
  font-size: 12px;
}

.upload-area:hover {
  border-color: var(--tea-green);
  color: var(--tea-green);
}

.upload-area .upload-icon {
  font-size: 28px;
  margin-bottom: 4px;
}

.upload-preview {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

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

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

.rich-editor { border: 1px solid var(--border-color); border-radius: 6px; overflow: hidden; }
.rich-toolbar { display: flex; gap: 8px; align-items: center; padding: 8px; background: #f8faf7; border-bottom: 1px solid var(--border-color); }
.rich-content, .rich-preview { min-height: 180px; max-height: 360px; overflow-y: auto; padding: 12px; line-height: 1.7; background: #fff; }
.rich-content:empty::before { content: attr(data-placeholder); color: #a8abb2; pointer-events: none; }
.rich-content img, .rich-preview img { max-width: 100%; height: auto; }
.rich-preview p { margin: 0 0 8px; }

/* 订单详情 */
.order-detail-section {
  margin-bottom: 20px;
}

.order-detail-section h4 {
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.order-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.detail-item {
  display: flex;
  font-size: 13px;
}

.detail-item .label {
  color: var(--text-tertiary);
  width: 80px;
  flex-shrink: 0;
}

.detail-item .value {
  color: var(--text-primary);
  flex: 1;
}

/* 分类树 */
.category-tree {
  max-width: 400px;
}

/* 选茶助手 */
.question-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-light);
}

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

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

.option-list {
  padding-left: 20px;
}

.option-item {
  padding: 8px 0;
  color: var(--text-secondary);
  border-bottom: 1px dashed var(--border-color);
}

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

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

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -220px;
    z-index: 1000;
    height: 100vh;
  }
  
  .sidebar.mobile-open {
    left: 0;
  }
  
  .stat-cards {
    grid-template-columns: 1fr;
  }
  
  .header {
    padding: 0 16px;
  }
  
  .content-area {
    padding: 12px;
  }
}

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

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

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

::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}
