/**
 * 公共样式文件
 * 包含项目中所有页面共有的样式定义
 * 风格：简洁、平面化
 */

/* 主题变量 */
:root {
  --primary-color: #8B4513;
  --primary-light: #A0522D;
  --primary-dark: #6B4423;
  --text-color: #2D3436;
  --text-light: #636E72;
  --bg-color: #F8F3EA;
  --bg-gradient: none;
  --accent-color: #D2691E;
  --card-shadow: 0 2px 8px rgba(139, 69, 19, 0.05);
  --btn-primary: #8B4513;
  --btn-secondary: rgba(139, 69, 19, 0.1);
  --border-radius-sm: 4px;
  --border-radius: 8px;
  --border-radius-lg: 12px;
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
}

/* 基础样式 */
body {
  background: var(--bg-color);
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-color);
  margin: 0;
  padding-bottom: 70px;
}

/* 移动端顶部标题栏 */
.mobile-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #FFF;
  box-shadow: 0 1px 2px rgba(139, 69, 19, 0.05);
  display: flex;
  align-items: center;
  padding: 0 var(--spacing);
  z-index: 1000;
}

.mobile-header__title {
  flex: 1;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-color);
  margin: 0;
}

.mobile-header__right {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  font-size: 24px;
}

/* 内容区域 */
.page-content {
  padding-top: var(--spacing);
  padding-bottom: 70px;
  padding-left: 0;
  padding-right: 0;
  max-width: 800px;
  margin: 0 auto;
}

/* 卡片样式 */
.card {
  background: white;
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  margin: var(--spacing);
  padding: var(--spacing);
  border-bottom: 1px solid rgba(139, 69, 19, 0.1);
}

/* 通用卡片样式 */
.common-card {
  background: white;
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: all 0.2s ease;
  position: relative;
  border-left: 3px solid var(--primary-color);
}

.common-card:active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(139, 69, 19, 0.04);
}

/* 表单样式 */
.form-control {
  border-radius: var(--border-radius);
  border: 1px solid rgba(139, 69, 19, 0.15);
  padding: 12px var(--spacing);
  background: white;
  box-shadow: none;
  font-size: 15px;
  height: 48px;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(139, 69, 19, 0.1);
}

/* 按钮样式 */
.btn-primary {
  border-radius: var(--border-radius);
  padding: 12px var(--spacing);
  background: var(--primary-color);
  border: none;
  color: white;
  font-weight: 500;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.btn-primary:hover, .btn-primary:active {
  background: var(--primary-dark);
}

.btn-secondary {
  border-radius: var(--border-radius);
  padding: 12px var(--spacing);
  background: rgba(139, 69, 19, 0.1);
  border: none;
  color: var(--primary-color);
  font-weight: 500;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.btn-secondary:hover, .btn-secondary:active {
  background: rgba(139, 69, 19, 0.15);
}

/* 下拉刷新和加载更多 */
.pull-to-refresh__indicator {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  font-size: 14px;
}

.pull-to-refresh__spinner {
  width: 18px;
  height: 18px;
  margin-right: var(--spacing-sm);
  border: 2px solid rgba(139, 69, 19, 0.1);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.load-more {
  text-align: center;
  padding: var(--spacing) 0;
  color: var(--text-light);
}

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

/* 空状态样式 */
.empty-state {
  text-align: center;
  padding: var(--spacing-xl) var(--spacing);
}
  
.empty-state i {
  font-size: 40px;
  color: var(--text-light);
  margin-bottom: var(--spacing);
  opacity: 0.7;
}

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

/* 加载完成提示 */
.load-all {
  text-align: center;
  padding: var(--spacing) 0;
  color: var(--text-light);
  font-size: 14px;
  font-weight: 500;
  position: relative;
  margin: var(--spacing) 0;
}

.load-all::before,
.load-all::after {
  content: '';
  display: inline-block;
  width: 40px;
  height: 1px;
  background: var(--text-light);
  opacity: 0.2;
  margin: 0 var(--spacing);
  vertical-align: middle;
}

/* 统计卡片样式 */
.stats-card {
  background: white;
  border-radius: var(--border-radius);
  padding: var(--spacing);
  margin: var(--spacing);
  box-shadow: var(--card-shadow);
  display: flex;
  justify-content: space-between;
}

.stats-item {
  text-align: center;
  flex: 1;
}

.stats-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: var(--spacing-xs);
}

.stats-label {
  font-size: 12px;
  color: var(--text-light);
}

/* 列表项样式 */
.list-item {
  display: flex;
  align-items: center;
  padding: var(--spacing);
  border-bottom: 1px solid rgba(139, 69, 19, 0.05);
  background: white;
}

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

.list-item__icon {
  margin-right: var(--spacing);
  color: var(--primary-color);
  font-size: 20px;
}

.list-item__content {
  flex: 1;
}

.list-item__title {
  font-weight: 500;
  margin-bottom: 2px;
}

.list-item__subtitle {
  font-size: 13px;
  color: var(--text-light);
}

/* 分隔线 */
.divider {
  height: 1px;
  background: rgba(139, 69, 19, 0.05);
  margin: var(--spacing) 0;
}

/* 响应式优化 */
@media (min-width: 768px) {
  .mobile-tabbar {
    display: none;
  }
  
  .page-content {
    max-width: 600px;
    margin: 0 auto;
  }
}

/* 数据统计卡片样式 - 适配界面图中的样式 */
.data-stats-card {
  background: white;
  border-radius: var(--border-radius);
  margin: var(--spacing);
  overflow: hidden;
}

.data-stats-header {
  background: rgba(139, 69, 19, 0.02);
  padding: var(--spacing);
  border-bottom: 1px solid rgba(139, 69, 19, 0.05);
}

.data-stats-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-color);
  margin: 0;
}

.data-stats-content {
  padding: var(--spacing);
}

.data-stats-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.data-stats-column {
  flex: 1;
  text-align: center;
}

.data-stats-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 4px;
}

.data-stats-value.accent {
  color: #e67e22;
}

.data-stats-label {
  font-size: 12px;
  color: var(--text-light);
}

.data-stats-sub-label {
  font-size: 11px;
  color: var(--text-light);
  opacity: 0.8;
}

/* 操作卡片样式 */
.action-card {
  background: white;
  border-radius: var(--border-radius);
  margin: var(--spacing);
  overflow: hidden;
}

.action-card-header {
  background: rgba(139, 69, 19, 0.02);
  padding: var(--spacing);
  border-bottom: 1px solid rgba(139, 69, 19, 0.05);
}

.action-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-color);
  margin: 0;
}

.action-card-content {
  padding: var(--spacing);
  display: flex;
  flex-wrap: wrap;
}

.action-card-item {
  width: 50%;
  padding: var(--spacing-sm);
  text-align: center;
}

.action-card-item-inner {
  background: rgba(139, 69, 19, 0.02);
  border-radius: var(--border-radius-sm);
  padding: var(--spacing);
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.action-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--spacing-sm);
  color: var(--primary-color);
  font-size: 20px;
  box-shadow: 0 2px 6px rgba(139, 69, 19, 0.1);
}

.action-card-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-color);
}

.action-card-subtext {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}

/* 页面过渡动画 */
.page-transition {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
}

/* 卡片悬停效果 */
.hover-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(139, 69, 19, 0.08);
}

/* 按钮波纹效果 */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: "";
  display: block;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
  background-repeat: no-repeat;
  background-position: 50%;
  transform: scale(10, 10);
  opacity: 0;
  transition: transform 0.5s, opacity 0.5s;
}

.ripple:active::after {
  transform: scale(0, 0);
  opacity: 0.3;
  transition: 0s;
} 