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

:root {
  --primary: #4E635A;
  --primary-light: #6B8C82;
  --bg: #F6F5F0;
  --white: #FFFFFF;
  --text: #1C1B1F;
  --text-secondary: #6B6B6B;
  --border: rgba(0,0,0,0.08);
  --shadow: 0 2rpx 16rpx rgba(78,99,90,0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.app {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
  width: 240px;
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
}

.logo {
  padding: 32px 24px;
  border-bottom: 1px solid var(--border);
}

.logo h1 {
  font-size: 24px;
  color: var(--primary);
  margin-bottom: 4px;
}

.logo p {
  font-size: 12px;
  color: var(--text-secondary);
}

.nav {
  flex: 1;
  padding: 16px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s;
}

.nav-item:hover {
  background: var(--bg);
  color: var(--primary);
}

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

.nav-item .icon {
  font-size: 18px;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
}

/* 主内容区 */
.main {
  flex: 1;
  margin-left: 240px;
  min-height: 100vh;
}

.header {
  background: var(--white);
  padding: 24px 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header h2 {
  font-size: 24px;
  font-weight: 700;
}

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

.time {
  font-size: 14px;
  color: var(--text-secondary);
}

.content {
  padding: 32px;
}

/* 页面 */
.page {
  animation: fadeIn 0.3s;
}

.page.hidden {
  display: none;
}

/* 通用隐藏类 */
.hidden {
  display: none !important;
}

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

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

.stat-card {
  background: var(--white);
  border-radius: 20px;
  padding: 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow);
}

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

.stat-icon.blue { background: rgba(78,99,90,0.1); }
.stat-icon.green { background: rgba(78,99,90,0.15); }
.stat-icon.orange { background: rgba(232,152,48,0.1); }
.stat-icon.pink { background: rgba(232,152,48,0.15); }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* 图表区域 */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.chart-card {
  background: var(--white);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.chart-card h3 {
  font-size: 18px;
  margin-bottom: 24px;
}

.chart {
  height: 200px;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 16px;
  padding: 20px 0;
}

.chart-bar {
  flex: 1;
  background: var(--primary);
  border-radius: 8px 8px 0 0;
  min-height: 10px;
  transition: height 0.5s ease;
  position: relative;
}

.chart-bar::after {
  content: attr(data-date);
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--text-secondary);
}

.chart-bar::before {
  content: attr(data-count);
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--text-secondary);
}

/* 心情统计 */
.mood-stats {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mood-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mood-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.mood-bar-wrap {
  flex: 1;
  height: 12px;
  background: rgba(0,0,0,0.05);
  border-radius: 6px;
  overflow: hidden;
}

.mood-bar {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease;
}

.mood-count {
  font-size: 14px;
  font-weight: 600;
  min-width: 40px;
  text-align: right;
}

/* 最近打卡 */
.recent-card {
  background: var(--white);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.recent-card h3 {
  font-size: 18px;
  margin-bottom: 24px;
}

/* 表格 */
.table-card {
  background: var(--white);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  font-size: 14px;
}

.data-table tr:hover {
  background: var(--bg);
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.mood-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.mood-badge.happy { background: rgba(232,152,48,0.15); color: #E89830; }
.mood-badge.neutral { background: rgba(141,154,142,0.15); color: #8D9A8E; }
.mood-badge.tired { background: rgba(169,158,142,0.15); color: #A99E8E; }
.mood-badge.sad { background: rgba(122,143,163,0.15); color: #7A8FA3; }
.mood-badge.calm { background: rgba(92,138,126,0.15); color: #5C8A7E; }

.openid-cell {
  font-family: monospace;
  font-size: 12px;
  color: var(--text-secondary);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.time-cell {
  color: var(--text-secondary);
  font-size: 13px;
}

.note-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 按钮 */
.btn {
  padding: 10px 20px;
  border-radius: 12px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-light);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
}

.btn-danger {
  background: rgba(220,53,69,0.1);
  color: #DC3545;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}

/* 筛选器 */
.filters {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.filters input,
.filters select {
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  background: var(--white);
}

.filters select {
  min-width: 120px;
}

/* 弹窗 */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--white);
  border-radius: 24px;
  padding: 32px;
  width: 100%;
  max-width: 400px;
}

.modal-content h3 {
  font-size: 20px;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.page-header {
  margin-bottom: 24px;
}

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