/* 情侣减肥打卡小程序 - 公共样式 */

:root {
  /* 轻奢配色方案 - 优雅金棕 + 深邃蓝 */
  --primary-color: #C9A063;        /* 香槟金 */
  --primary-dark: #A67C52;         /* 深金棕 */
  --secondary-color: #2C3E50;      /* 深邃蓝灰 */
  --accent-color: #E8D5B7;         /* 浅金米 */
  --user-a-color: #5D9CEC;         /* 优雅蓝 */
  --user-b-color: #EC87C0;         /* 柔和粉 */
  --success-color: #81C784;        /* 柔和绿 */
  --warning-color: #FFB74D;        /* 温暖橙 */
  --danger-color: #E57373;         /* 柔和红 */
  --bg-color: #F8F6F4;             /* 米白背景 */
  --card-bg: #FFFFFF;              /* 纯白卡片 */
  --text-primary: #2C3E50;         /* 深色文字 */
  --text-secondary: #7F8C8D;       /* 灰色文字 */
  --border-color: #E8E6E3;         /* 浅灰边框 */
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 24px rgba(0,0,0,0.12);
  --shadow-soft: 0 2px 8px rgba(201, 160, 99, 0.15);
  --border-radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(135deg, #F8F6F4 0%, #E8E6E3 100%);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.6;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(201, 160, 99, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(44, 62, 80, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* 导航栏 */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 15px 20px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-title {
  font-size: 20px;
  font-weight: bold;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar-menu {
  display: flex;
  gap: 15px;
  list-style: none;
}

.navbar-menu a {
  color: var(--text-primary);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  transition: var(--transition);
  font-size: 14px;
}

.navbar-menu a:hover {
  background: var(--bg-color);
  color: var(--primary-color);
}

.navbar-menu a.active {
  background: var(--primary-color);
  color: white;
}

/* 卡片样式 */
.card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  margin-bottom: 20px;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--border-color);
}

.card-title {
  font-size: 18px;
  font-weight: bold;
  color: var(--text-primary);
}

.card-body {
  color: var(--text-secondary);
}

/* 按钮样式 */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: #45a049;
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.btn-secondary {
  background: var(--secondary-color);
  color: white;
}

.btn-secondary:hover {
  background: #1976D2;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover {
  background: var(--primary-color);
  color: white;
}

.btn-danger {
  background: var(--danger-color);
  color: white;
}

.btn-danger:hover {
  background: #d32f2f;
}

.btn-block {
  width: 100%;
  display: block;
}

/* 表单样式 */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 16px;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.form-select {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 16px;
  background: white;
  cursor: pointer;
}

/* 用户标识 */
.user-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  color: white;
}

.user-badge.user-a {
  background: var(--user-a-color);
}

.user-badge.user-b {
  background: var(--user-b-color);
}

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.stat-card {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.stat-label {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 32px;
  font-weight: bold;
}

.stat-unit {
  font-size: 18px;
  opacity: 0.9;
  margin-left: 4px;
}

/* 对比卡片 */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.compare-card {
  background: var(--card-bg);
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  text-align: center;
}

.compare-card.user-a {
  border-top: 4px solid var(--user-a-color);
}

.compare-card.user-b {
  border-top: 4px solid var(--user-b-color);
}

/* 进度条 */
.progress {
  height: 24px;
  background: var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  margin: 10px 0;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  font-weight: bold;
}

/* 标签 */
.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  margin: 4px;
}

.tag-success {
  background: #e8f5e9;
  color: var(--success-color);
}

.tag-warning {
  background: #fff3e0;
  color: var(--warning-color);
}

.tag-info {
  background: #e3f2fd;
  color: var(--secondary-color);
}

/* 表格样式 */
.table-responsive {
  overflow-x: auto;
  margin: 20px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
}

thead {
  background: var(--primary-color);
  color: white;
}

th, td {
  padding: 12px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

tbody tr:hover {
  background: var(--bg-color);
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 18px;
  margin-bottom: 20px;
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 提示框 */
.alert {
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success {
  background: #e8f5e9;
  color: var(--success-color);
  border-left: 4px solid var(--success-color);
}

.alert-warning {
  background: #fff3e0;
  color: var(--warning-color);
  border-left: 4px solid var(--warning-color);
}

.alert-info {
  background: #e3f2fd;
  color: var(--secondary-color);
  border-left: 4px solid var(--secondary-color);
}

/* 模态框 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: var(--border-radius);
  padding: 30px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 20px;
  font-weight: bold;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }
  
  .navbar-menu {
    gap: 8px;
  }
  
  .navbar-menu a {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .compare-grid {
    grid-template-columns: 1fr;
  }
  
  .card {
    padding: 15px;
  }
  
  .stat-value {
    font-size: 24px;
  }
  
  table {
    font-size: 14px;
  }
  
  th, td {
    padding: 8px 4px;
  }
}

/* 工具类 */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.flex { display: flex; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }
