/* 自定义样式 */
:root {
  --primary-color: #7857FF;
  --primary-light: #A18AFF;
  --primary-dark: #5A3FD6;
  --secondary-color: #FE6057;
  --secondary-light: #FF8C85;
  --accent-color: #41DCB3;
  --background-light: #F8F8FD;
  --background-dark: #333542;
  --text-dark: #333542;
  --text-medium: #71727A;
  --text-light: #9FA0A7;
  --success-color: #41DCB3;
  --warning-color: #FFBB54;
  --danger-color: #FE6057;
}

.iphone-frame {
  position: relative;
  width: 375px;
  height: 812px;
  background-color: #fff;
  border-radius: 40px;
  box-shadow: 0 20px 40px rgba(120, 87, 255, 0.15);
  overflow: hidden;
  margin: 20px auto;
}

.iphone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 30px;
  background-color: #000;
  border-bottom-left-radius: 15px;
  border-bottom-right-radius: 15px;
  z-index: 10;
}

.app-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100% - 70px);
  z-index: 1;
  overflow: auto;
  background-color: var(--background-light);
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 87, 255, 0.3) transparent;
}

.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background-color: #fff;
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid rgba(120, 87, 255, 0.1);
  z-index: 10;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 20%;
  color: var(--text-light);
  font-size: 12px;
  transition: all 0.3s;
}

.nav-item.active {
  color: var(--primary-color);
}

.nav-icon {
  font-size: 22px;
  margin-bottom: 3px;
}

/* 卡片样式 */
.data-card {
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(120, 87, 255, 0.07);
  transition: all 0.3s;
}

.data-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(120, 87, 255, 0.12);
}

/* 趋势图样式 */
.trend-chart {
  height: 200px;
  position: relative;
}

/* 渐变背景 */
.gradient-bg {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
}

/* 预警标签 */
.warning-badge {
  background-color: var(--danger-color);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
}

/* 库存项 */
.inventory-item {
  border-radius: 16px;
  transition: all 0.3s;
}

.inventory-item:hover {
  background-color: #F8F8FD;
}

/* 自定义滚动条 - 只在滚动时显示 */
.app-content::-webkit-scrollbar {
  width: 4px;
  background-color: transparent;
}

.app-content::-webkit-scrollbar-track {
  background: transparent;
}

.app-content::-webkit-scrollbar-thumb {
  background: var(--primary-light);
  border-radius: 4px;
}

/* 滚动容器中有滚动条但未滚动时隐藏 */
.app-content:not(:hover)::-webkit-scrollbar-thumb {
  background: transparent;
}

.app-content:hover::-webkit-scrollbar-thumb {
  background: var(--primary-light);
}

/* 分类导航样式 */
.categories-scrollbar {
  overflow-x: auto;
  scrollbar-width: none;
}

.categories-scrollbar::-webkit-scrollbar {
  height: 0;
  display: none;
}

/* 分类按钮样式 */
.category-btn {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 15px;
  background-color: #f3f4f6;
  color: var(--text-medium);
  white-space: nowrap;
  transition: all 0.3s;
  border: 1px solid transparent;
}

.category-btn.active {
  background-color: var(--primary-color);
  color: white;
  font-weight: 500;
}

.category-btn:not(.active):hover {
  background-color: #e9ecef;
}

/* 浮动操作按钮 */
.floating-action-btn {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-color);
  color: white;
  box-shadow: 0 4px 15px rgba(120, 87, 255, 0.4);
  z-index: 100;
  transition: all 0.3s;
}

.floating-action-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(120, 87, 255, 0.5);
}

/* 数据看板样式 */
.stat-value {
  font-size: 24px;
  font-weight: bold;
  color: var(--text-dark);
}

.stat-label {
  font-size: 14px;
  color: var(--text-medium);
}

/* 交易记录样式 */
.transaction-item {
  border-bottom: 1px solid rgba(120, 87, 255, 0.1);
  padding: 12px 0;
}

/* 报表筛选器 */
.report-filter {
  background-color: #F0EDFF;
  border-radius: 16px;
  padding: 12px 16px;
}

/* 图表容器 */
.chart-container {
  height: 250px;
  position: relative;
}

/* 按钮样式 */
.btn-primary {
  background-color: var(--primary-color);
  color: white;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
  transition: all 0.3s;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: white;
  color: var(--primary-color);
  border: 1.5px solid var(--primary-color);
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
  transition: all 0.3s;
}

.btn-secondary:hover {
  background-color: #F0EDFF;
}

/* 标签样式 */
.tag {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.tag-primary {
  background-color: #F0EDFF;
  color: var(--primary-color);
}

.tag-success {
  background-color: rgba(65, 220, 179, 0.15);
  color: var(--success-color);
}

.tag-warning {
  background-color: rgba(255, 187, 84, 0.15);
  color: var(--warning-color);
}

.tag-danger {
  background-color: rgba(254, 96, 87, 0.15);
  color: var(--danger-color);
}

/* 基础样式 */
body {
  font-family: 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: #333;
  position: relative;
  min-height: 100vh;
  padding-bottom: 60px; /* 为底部导航留出空间 */
}

/* 自定义滚动条样式 - 添加仅在滚动时显示的样式 */
body, .app-content, .overflow-x-auto, .overflow-y-auto {
  scrollbar-width: thin;
  scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
}

body::-webkit-scrollbar,
.app-content::-webkit-scrollbar,
.overflow-x-auto::-webkit-scrollbar,
.overflow-y-auto::-webkit-scrollbar {
  width: 6px;
  height: 6px;
  background: transparent;
}

body::-webkit-scrollbar-thumb,
.app-content::-webkit-scrollbar-thumb,
.overflow-x-auto::-webkit-scrollbar-thumb,
.overflow-y-auto::-webkit-scrollbar-thumb {
  background: rgba(156, 163, 175, 0.5);
  border-radius: 6px;
}

/* 隐藏滚动条，仅在滚动时显示 */
body:not(:hover)::-webkit-scrollbar-thumb,
.app-content:not(:hover)::-webkit-scrollbar-thumb,
.overflow-x-auto:not(:hover)::-webkit-scrollbar-thumb,
.overflow-y-auto:not(:hover)::-webkit-scrollbar-thumb {
  background: transparent;
}

body:hover::-webkit-scrollbar-thumb,
.app-content:hover::-webkit-scrollbar-thumb,
.overflow-x-auto:hover::-webkit-scrollbar-thumb,
.overflow-y-auto:hover::-webkit-scrollbar-thumb {
  background: rgba(156, 163, 175, 0.5);
}

/* 主内容区域 */
.app-content {
  padding-top: 10px;
  overflow: auto; /* 修改为auto，仅在需要时显示滚动条 */
  height: calc(100vh - 60px - 58px); /* 头部高度(60) + 底部导航(58) */
}

/* 数据卡片 */
.data-card {
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

/* 统计数值 */
.stat-value {
  font-size: 24px;
  font-weight: 600;
  color: #333;
  padding: 4px 0;
}

/* 预警标签 */
.warning-badge {
  background-color: #FEF2F2;
  color: #EF4444;
  padding: 1px 8px;
  border-radius: 12px;
  font-size: 12px;
}

/* 浮动操作按钮 */
.floating-action-btn {
  position: fixed;
  width: 56px;
  height: 56px;
  bottom: 70px;
  right: 16px;
  background: linear-gradient(135deg, #7857FF, #6744E9);
  color: white;
  border-radius: 50%;
  text-align: center;
  box-shadow: 0 4px 12px rgba(120, 87, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

/* 底部导航栏 */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: white;
  box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 4px;
  z-index: 100;
}

.bottom-nav a {
  color: #9CA3AF;
  padding: 5px 0;
  text-align: center;
  font-size: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bottom-nav a.active {
  color: #6744E9;
}

.bottom-nav i {
  font-size: 18px;
  margin-bottom: 3px;
}

/* 类别按钮样式 - 减小文字大小并添加边框 */
.category-btn {
  font-size: 0.8rem; /* 减小文字大小 */
  padding: 0.5rem 0.75rem;
  white-space: nowrap;
  border: 1px solid #e5e7eb; /* 添加边框 */
  border-radius: 0.375rem;
  margin-right: 0.5rem;
}

.category-btn.active {
  background-color: #6744E9;
  color: white;
  border-color: #6744E9;
}

/* 库存和交易页面的筛选按钮 */
.filter-btn {
  display: flex;
  align-items: center;
  padding: 0.4rem 0.75rem;
  background-color: #F3F4F6;
  border-radius: 9999px;
  font-size: 0.75rem;
  color: #4B5563;
}

/* 商品卡片 */
.product-card {
  display: flex;
  padding: 12px;
  background-color: white;
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.product-image {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  margin-right: 12px;
}

.product-info {
  flex: 1;
}

.product-title {
  font-weight: 500;
  margin-bottom: 4px;
}

.product-price {
  color: #EF4444;
  font-weight: 500;
  font-size: 16px;
}

.product-stats {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 12px;
  color: #9CA3AF;
}

/* 交易记录样式 */
.transaction-item {
  border-bottom: 1px solid #F3F4F6;
  padding: 12px 0;
}

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

.transaction-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.transaction-title {
  font-weight: 500;
}

.transaction-amount {
  font-weight: 600;
}

.transaction-amount.income {
  color: #10B981;
}

.transaction-amount.expense {
  color: #EF4444;
}

.transaction-info {
  display: flex;
  justify-content: space-between;
  color: #9CA3AF;
  font-size: 12px;
}

/* 标签样式 */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  margin-right: 4px;
}

.tag-blue {
  background-color: #EFF6FF;
  color: #3B82F6;
}

.tag-green {
  background-color: #ECFDF5;
  color: #10B981;
}

.tag-red {
  background-color: #FEF2F2;
  color: #EF4444;
}

.tag-yellow {
  background-color: #FFFBEB;
  color: #F59E0B;
}

.tag-purple {
  background-color: #F5F3FF;
  color: #8B5CF6;
}

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

.form-label {
  display: block;
  margin-bottom: 6px;
  color: #4B5563;
  font-size: 14px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  font-size: 14px;
}

.form-control:focus {
  border-color: #6744E9;
  outline: none;
  box-shadow: 0 0 0 2px rgba(103, 68, 233, 0.1);
}

/* 按钮样式 */
.btn {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background-color: #6744E9;
  color: white;
  border: none;
}

.btn-primary:hover {
  background-color: #5935C8;
}

.btn-secondary {
  background-color: #F3F4F6;
  color: #4B5563;
  border: none;
}

.btn-secondary:hover {
  background-color: #E5E7EB;
}

/* 搜索框样式 */
.search-box {
  position: relative;
  margin-bottom: 16px;
}

.search-input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  font-size: 14px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9CA3AF;
}

/* iPhone 15 状态栏样式 */
.iphone-status-bar {
  position: relative;
  height: 44px;
  background-color: #fff;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  color: #000;
  z-index: 50;
}

.status-left {
  width: 80px;
  text-align: left;
}

.status-center {
  position: absolute;
  width: 180px;
  height: 30px;
  background-color: #000;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  z-index: 60;
}

.status-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 80px;
}

.battery-icon {
  width: 24px;
  height: 12px;
  border: 1px solid #000;
  border-radius: 3px;
  padding: 1px;
  position: relative;
  margin-left: 5px;
}

.battery-icon::after {
  content: '';
  position: absolute;
  width: 2px;
  height: 4px;
  background: #000;
  right: -3px;
  top: 3px;
  border-radius: 0 2px 2px 0;
}

.battery-level {
  height: 100%;
  width: 80%;
  background-color: #000;
  border-radius: 1px;
} 