:root {
  --primary: #0061b0;
  --primary-light: #e6f0fa;
  --primary-dark: #004a87;
  --background: #f5f7fa;
  --surface: #ffffff;
  --text: #333333;
  --text-secondary: #666666;
  --text-tertiary: #999999;
  --border: #e5e5e5;
  --success: #52c41a;
  --warning: #faad14;
  --danger: #f5222d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--background);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--background);
  position: relative;
  padding-bottom: 80px;
}

.page {
  display: none;
  padding: 16px;
}

.page.active {
  display: block;
}

.card {
  background: var(--surface);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
}

.card-title::before {
  content: '';
  width: 4px;
  height: 16px;
  background: var(--primary);
  border-radius: 2px;
  margin-right: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 500;
  border: none;
  padding: 0 20px;
  cursor: pointer;
  width: 100%;
}

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

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

.btn-danger {
  background: #fff1f0;
  color: var(--danger);
}

.btn-sm {
  height: 36px;
  font-size: 14px;
  padding: 0 14px;
  width: auto;
}

.form-item {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 8px;
}

.form-input,
.picker {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
}

.amount-display {
  display: flex;
  align-items: center;
  color: var(--primary);
  font-weight: 600;
  background: var(--primary-light);
}

.member-check-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.member-check-item {
  padding: 8px 16px;
  border-radius: 10px;
  background: #f5f7fa;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  border: 2px solid transparent;
}

.member-check-item.checked {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
  font-weight: 500;
}

.type-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.type-item {
  flex: 1;
  min-width: 70px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f7fa;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  border: 2px solid transparent;
}

.type-item.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
  font-weight: 600;
}

.room-item,
.ticket-item {
  background: #fafafa;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}

.room-header,
.ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 600;
}

.text-danger {
  color: var(--danger);
  cursor: pointer;
  font-size: 14px;
  font-weight: normal;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
  text-align: center;
}

.empty-state img {
  width: 120px;
  height: 120px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 0;
}

.header img {
  width: 100px;
  height: 100px;
  border-radius: 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(0, 97, 176, 0.2);
}

.header .title {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}

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

.trip-item,
.member-item,
.bill-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.trip-item:last-child,
.member-item:last-child {
  border-bottom: none;
}

.trip-info {
  flex: 1;
}

.trip-name,
.member-name {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
}

.trip-meta {
  font-size: 14px;
  color: var(--primary);
  font-weight: 500;
}

.trip-time {
  font-size: 12px;
  color: var(--text-tertiary);
}

.actions {
  display: flex;
  gap: 8px;
}

.modal-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: none;
}

.modal-mask.active {
  display: block;
}

.modal-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 85%;
  max-width: 360px;
  background: var(--surface);
  border-radius: 16px;
  padding: 24px;
  z-index: 101;
  display: none;
}

.modal-content.active {
  display: block;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.modal-actions .btn {
  flex: 1;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 60px;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 50;
}

.nav-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 14px;
  cursor: pointer;
}

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

.total-card {
  background: linear-gradient(135deg, #0061b0 0%, #2e9fff 100%);
  color: #fff;
  text-align: center;
  padding: 32px 16px;
}

.total-label {
  font-size: 15px;
  opacity: 0.9;
  margin-bottom: 8px;
}

.total-amount {
  font-size: 42px;
  font-weight: 700;
}

.settle-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

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

.settle-name {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
}

.settle-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.settle-balance {
  font-size: 16px;
  font-weight: 600;
}

.settle-balance.pay {
  color: var(--danger);
}

.settle-balance.receive {
  color: var(--success);
}

.settle-balance.clear {
  color: var(--text-tertiary);
}

.type-list {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.type-row {
  display: flex;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
}

.type-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
}

.type-name {
  flex: 1;
}

.type-percent {
  width: 60px;
  text-align: right;
  margin-right: 12px;
  color: var(--text-secondary);
}

.type-value {
  width: 80px;
  text-align: right;
  font-weight: 500;
}

.pie-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pie-canvas {
  margin-bottom: 16px;
}

.pie-legend {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}

.legend-name {
  margin-right: 6px;
}

.legend-value {
  color: var(--text);
  font-weight: 500;
}

.summary-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

.bill-type {
  font-size: 17px;
  font-weight: 600;
}

.bill-amount {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.bill-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
  margin: 6px 0;
}

.bill-note {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.bill-actions {
  display: flex;
  justify-content: flex-end;
}

.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.stat-bill-list {
  margin-top: 4px;
}

.stat-bill-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

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

.stat-bill-header {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  font-size: 15px;
}

.stat-bill-date {
  width: 90px;
  color: var(--text-secondary);
}

.stat-bill-type {
  flex: 1;
  font-weight: 500;
  color: var(--text);
}

.stat-bill-amount {
  width: 80px;
  text-align: right;
  font-weight: 600;
  color: var(--primary);
}

.stat-bill-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text-secondary);
  padding-left: 90px;
}

.stat-bill-detail {
  color: var(--text);
}

.stat-bill-note {
  color: var(--text-tertiary);
  font-size: 12px;
}

.empty-mini {
  text-align: center;
  padding: 20px 0;
  font-size: 14px;
  color: var(--text-tertiary);
}
