/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Microsoft YaHei", sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
  overflow: hidden; /* 防止body滚动 */
}

/* 输入页面样式 */
.center-page {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.center-page img {
  width: 200px;
  height: auto;
  margin-bottom: 20px;
}

.center-page h1 {
  font-size: 2em;
  margin-bottom: 2em;
  color: #2c3e50;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.center-page input {
  width: 80%;
  max-width: 300px;
  padding: 12px 20px;
  margin: 8px 0;
  border: 2px solid #ddd;
  border-radius: 25px;
  font-size: 16px;
  transition: all 0.3s ease;
}

.center-page input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 10px rgba(52,152,219,0.3);
}

.center-page button {
  margin-top: 20px;
  padding: 12px 30px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 25px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.center-page button:hover {
  background: #2980b9;
  transform: translateY(-2px);
}

/* 开场白页面样式 */
#openingPage {
  height: 100vh;
  position: relative;
  overflow: hidden;
}

.opening-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('assets/bg.jpg') center/cover;
  filter: brightness(0.7);
}

.opening-content {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  text-align: center;
  padding: 20px;
}

.chinese-title {
  font-size: 3em;
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1s ease forwards;
}

.english-title {
  font-size: 1.5em;
  margin-bottom: 40px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1s ease 0.5s forwards;
}

.small-tip {
  font-size: 1.2em;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1s ease 1s forwards;
}

/* 月度总结页样式 */
#summaryPage {
  height: 100vh;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.summary-container {
  height: 100vh;
  position: relative;
  overflow: hidden;
}

.summary-page {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease;
  display: none;
  overflow: hidden;
}

.summary-page.active {
  opacity: 1;
  display: block;
}

.page-content {
  height: 100%;
  padding: 20px;
  overflow: hidden;
  position: relative;
}

.welcome-text {
  font-size: 2.5em;
  color: #2c3e50;
  margin-bottom: 20px;
  animation: fadeInUp 1s ease;
}

.highlight-text {
  font-size: 2em;
  color: #2c3e50;
  margin-bottom: 20px;
  animation: fadeInUp 1s ease;
}

.subtitle {
  font-size: 1.2em;
  color: #666;
  margin-bottom: 30px;
  animation: fadeInUp 1s ease 0.3s forwards;
  opacity: 0;
}

.avatar-container {
  margin: 30px 0;
  animation: scaleIn 1s ease 0.6s forwards;
  opacity: 0;
}

.avatar-container img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 4px solid #3498db;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.info-card {
  background: rgba(255,255,255,0.9);
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  margin-top: 20px;
  transform: translateY(20px);
  animation: fadeInUp 1s ease 0.3s forwards;
  opacity: 0;
  overflow: hidden;
  position: relative;
}

.info-card p {
  margin: 10px 0;
  font-size: 1.1em;
  color: #2c3e50;
}

.page-indicators {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 15px;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.2);
  padding: 10px 20px;
  border-radius: 20px;
}

.indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.indicator:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: scale(1.1);
}

.indicator.active {
  background: #fff;
  transform: scale(1.2);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

@keyframes scaleIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* 音乐控制按钮 */
#musicControl {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.8);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  z-index: 1000;
}

/* 动画效果 */
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .welcome-text {
    font-size: 2em;
  }
  
  .highlight-text {
    font-size: 1.5em;
  }
  
  .subtitle {
    font-size: 1em;
  }
  
  .avatar-container img {
    width: 120px;
    height: 120px;
  }
}

.highlight-time {
  font-size: 1.4em;
  color: #2c3e50;
  margin-bottom: 15px;
  font-weight: bold;
  animation: fadeInUp 1s ease 0.3s forwards;
  opacity: 0;
}

.time-text {
  font-size: 2.5em;
  color: #3498db;
  margin: 20px 0;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
  animation: fadeInUp 1s ease 0.6s forwards;
  opacity: 0;
  min-height: 1.2em;
}

#createTime {
  display: inline-block;
  padding: 5px 10px;
  background: rgba(52, 152, 219, 0.1);
  border-radius: 8px;
  color: #2980b9;
  font-weight: bold;
}

.time-desc {
  font-size: 1.1em;
  color: #666;
  font-style: italic;
  margin-top: 15px;
  animation: fadeInUp 1s ease 0.9s forwards;
  opacity: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .welcome-text {
    font-size: 2em;
  }
  
  .highlight-text {
    font-size: 1.5em;
  }
  
  .subtitle {
    font-size: 1em;
  }
  
  .time-text {
    font-size: 2em;
  }
  
  #createTime {
    font-size: 0.9em;
  }
  
  .highlight-time {
    font-size: 1.2em;
  }
  
  .time-desc {
    font-size: 1em;
  }
}

/* 移除旧的导航按钮样式 */
.page-nav-buttons,
.nav-button,
.prev-button,
.next-button {
  display: none;
}

/* 消费数据页面样式 */
.consumption-summary {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.consumption-details {
    margin-top: 20px;
}

.consumption-details h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.order-details {
    overflow-x: auto;
    margin: 0 -15px;
    padding: 0 15px;
}

.order-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.order-table th {
    background: #f8f9fa;
    color: #2c3e50;
    font-weight: 500;
    white-space: nowrap;
}

.order-table td {
    color: #666;
}

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

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

/* 响应式调整 */
@media (max-width: 768px) {
    .order-details {
        margin: 0 -10px;
        padding: 0 10px;
    }
    
    .order-table th,
    .order-table td {
        padding: 8px 10px;
        font-size: 14px;
    }
}

/* 消费记录标题和视图切换的容器 */
.order-header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    width: 100%;
}

.order-title {
    margin: 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
    color: #2c3e50;
    font-size: 1.2em;
    font-weight: 500;
}

/* 视图切换选项 */
.view-options {
    display: flex;
    gap: 10px;
    margin: 0;
}

.view-option {
    padding: 4px 12px;
    border: 1px solid #3498db;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    color: #3498db;
    font-size: 0.9em;
}

.view-option.active {
    background: #3498db;
    color: white;
}

/* 消费记录视图容器 */
.consumption-view {
    width: 100%;
    height: 400px;
    position: relative;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 列表视图 */
.order-list {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 15px;
    box-sizing: border-box;
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    background: white;
    border-radius: 8px;
    z-index: 1;
}

.order-list.active {
    display: block;
}

.order-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #eee;
}

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

.product-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-name {
    font-weight: 500;
    color: #2c3e50;
    font-size: 1.1em;
}

.quantity {
    color: #666;
    font-size: 0.9em;
}

.price-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.unit-price, .total-price {
    color: #666;
    font-size: 0.9em;
}

.order-footer {
    display: flex;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid #eee;
    font-size: 0.9em;
    color: #666;
}

.order-time {
    color: #666;
}

.order-status {
    color: #3498db;
}

/* 图表视图 */
.chart-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    background: white;
    border-radius: 8px;
    padding: 20px;
    /* box-shadow: 0 2px 4px rgba(0,0,0,0.1); */
    box-sizing: border-box;
    z-index: 1;
}

.chart-view.active {
    display: block;
}

#consumptionChart {
    width: 100%;
    height: 100%;
}

/* 视图切换时的过渡效果 */
.order-list, .chart-view {
    transition: opacity 0.3s ease;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .order-header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .view-options {
        width: 100%;
        justify-content: flex-start;
    }

    .view-option {
        flex: 1;
        text-align: center;
    }

    .consumption-view {
        height: 350px;
    }

    .chart-view {
        padding: 15px;
    }

    #consumptionChart {
        height: 300px;
    }

    .order-item {
        padding: 12px;
    }

    .product-name {
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .consumption-view {
        height: 300px;
    }

    .chart-view {
        padding: 10px;
    }

    #consumptionChart {
        height: 250px;
    }

    .order-item {
        padding: 10px;
    }

    .product-name {
        font-size: 0.9em;
    }

    .order-footer {
        font-size: 0.8em;
    }
}

/* 日期选择器 */
.date-selector {
  display: none;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.chart-view.active .date-selector {
  display: flex;
}

/* 年份选择器 */
.year-selector {
  display: flex;
  gap: 10px;
  padding: 5px 0;
}

.year-option {
  padding: 6px 16px;
  border: 1px solid #ddd;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
  font-weight: 500;
}

.year-option.active {
  background: #3498db;
  color: white;
  border-color: #3498db;
}

/* 月份选择器 */
.month-selector {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 5px 0;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.month-selector::-webkit-scrollbar {
  display: none;
}

.month-option {
  padding: 6px 16px;
  border: 1px solid #ddd;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s ease;
  background: white;
}

.month-option.active {
  background: #3498db;
  color: white;
  border-color: #3498db;
}

/* 图表视图布局优化 */
.chart-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
}

.date-selector {
  flex-shrink: 0;
  width: 100%;
  margin-bottom: 0px;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .chart-view {
    padding: 10px;
  }

  #consumptionChart {
    max-width: 350px;
    margin-top: -40px;
  }
}

@media (max-width: 480px) {
  .chart-view {
    padding: 10px;
  }

  #consumptionChart {
    max-width: 300px;
    margin-top: 0px;
  }
}

/* 隐藏滚动条但保持滚动功能 */
#page4::-webkit-scrollbar,
.page-content::-webkit-scrollbar,
.order-list::-webkit-scrollbar,
.month-selector::-webkit-scrollbar {
    display: none;
}

#page4,
.page-content,
.order-list,
.month-selector {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* 页面整体响应式优化 */
@media (max-width: 768px) {
  .page-content {
    margin-top: 20px;
    padding: 5px;
  }

  .info-card {
    padding: 20px;
    margin-top: 0px;
  }

  .order-header-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .view-options {
    width: 100%;
    justify-content: flex-start;
  }

  .view-option {
    flex: 1;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .page-content {
    margin-top: 15px;
    padding: 10px;
  }

  .info-card {
    padding: 15px;
    margin-top: 10px;
  }

  .order-header-container {
    gap: 8px;
  }

  .view-options {
    gap: 5px;
  }

  .view-option {
    padding: 3px 8px;
    font-size: 0.8em;
  }
}

/* 优化页面指示器在移动设备上的显示 */
@media (max-width: 768px) {
  .page-indicators {
    bottom: 20px;
    padding: 8px 15px;
    gap: 10px;
  }

  .indicator {
    width: 10px;
    height: 10px;
  }
}

@media (max-width: 480px) {
  .page-indicators {
    bottom: 15px;
    padding: 6px 12px;
    gap: 8px;
  }

  .indicator {
    width: 8px;
    height: 8px;
  }
}

/* 优化音乐控制按钮在移动设备上的显示 */
@media (max-width: 768px) {
  #musicControl {
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
  }
}

@media (max-width: 480px) {
  #musicControl {
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
  }
}

/* 优化无订单时的显示 */
.no-orders {
  text-align: center;
  padding: 20px;
  color: #666;
  font-size: 1.1em;
}

@media (max-width: 768px) {
  .no-orders {
    padding: 15px;
    font-size: 1em;
  }
}

@media (max-width: 480px) {
  .no-orders {
    padding: 10px;
    font-size: 0.9em;
  }
}

.commission-detail {
    margin-top: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.commission-detail h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
}

.chart-container {
    position: relative;
    height: 200px;
    width: 100%;
}

#commissionChart {
    width: 100% !important;
    height: 100% !important;
}

/* 消费记录图表样式 */
.consumption-detail {
    margin-top: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.consumption-detail h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
}

.chart-view {
    position: relative;
    height: 200px;
    width: 100%;
}

#consumptionChart {
    width: 100% !important;
    height: 100% !important;
}

/* 佣金日期选择器样式 */
.commission-date-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 12px;
}

.commission-year-selector,
.commission-month-selector {
    display: flex;
    gap: 10px;
    padding: 5px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

.commission-year-selector .year-option,
.commission-month-selector .month-option {
    padding: 8px 16px;
    border: 1px solid #3498db;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    color: #3498db;
    font-weight: 500;
    min-width: 80px;
    text-align: center;
}

.commission-year-selector .year-option:hover,
.commission-month-selector .month-option:hover {
    background: #3498db;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.commission-year-selector .year-option.active,
.commission-month-selector .month-option.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .commission-date-selector {
        padding: 10px;
        gap: 10px;
    }

    .commission-year-selector .year-option,
    .commission-month-selector .month-option {
        padding: 6px 12px;
        min-width: 60px;
        font-size: 14px;
    }
}

/* 第四页特殊样式 */
#page4 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#page4 .page-content {
    height: auto;
    min-height: 100%;
    padding: 20px;
    padding-bottom: 80px;
}

#page4 .info-card {
    margin-bottom: 20px;
}

#page4 .commission-detail {
    margin-bottom: 20px;
}

/* 页面指示器样式 */
.page-indicators {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 20px;
    border-radius: 20px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    #page4 .page-content {
        padding-bottom: 60px;
    }
}

@media (max-width: 480px) {
    #page4 .page-content {
        padding-bottom: 50px;
    }
}
