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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f5;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* 登录页面 */
.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 400px;
}

.login-box h1 {
  text-align: center;
  margin-bottom: 30px;
  color: #333;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #555;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: #f0f0f0;
  color: #333;
}

.btn-danger {
  background: #ff4757;
  color: white;
}

.error-msg {
  color: #ff4757;
  text-align: center;
  margin-bottom: 15px;
}

.toggle-link {
  text-align: center;
  margin-top: 20px;
  color: #666;
}

.toggle-link a {
  color: #667eea;
  cursor: pointer;
  text-decoration: none;
}

/* 导航栏 */
.navbar {
  background: white;
  padding: 15px 30px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar h1 {
  font-size: 24px;
  color: #333;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.navbar-right span {
  color: #666;
}

/* 统计卡片 */
.stats-grid {
  display: flex;
  gap: 10px;
  margin: 15px 0;
}

.stats-grid .stat-card {
  flex: 1;
}

.stats-grid-4 {
  display: flex;
  gap: 8px;
  margin: 15px 0;
}

.stat-card-mini {
  flex: 1;
  background: white;
  padding: 12px 8px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  text-align: center;
}

.stat-card-mini h3 {
  color: #888;
  font-size: 12px;
  margin-bottom: 6px;
}

.stat-card-mini .value {
  font-size: 16px;
  font-weight: bold;
}

.stat-card-mini.expense .value { color: #ff4757; }
.stat-card-mini.income .value { color: #2ed573; }
.stat-card-mini.net .value { color: #667eea; }
.stat-card-mini.count .value { color: #ffa502; }
.stat-card-mini.random .value { font-size: 24px; }
.stat-card-mini.random:active { transform: scale(0.95); }

.stat-card {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.stat-card h3 {
  color: #888;
  font-size: 14px;
  margin-bottom: 10px;
}

.stat-card .value {
  font-size: 20px;
  font-weight: bold;
}

.stat-card.expense .value { color: #ff4757; }
.stat-card.income .value { color: #2ed573; }
.stat-card.net .value { color: #667eea; }

/* 彩票列表 */
.ticket-list {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  overflow: hidden;
}

.ticket-list-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ticket-item {
  padding: 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.ticket-info h4 {
  margin-bottom: 5px;
  color: #333;
}

.ticket-info p {
  color: #888;
  font-size: 14px;
}

.ticket-status {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.ticket-status.pending { background: #fff3cd; color: #856404; }
.ticket-status.won { background: #d4edda; color: #155724; }
.ticket-status.lost { background: #f8d7da; color: #721c24; }

/* 拍照组件 - 全屏 */
.camera-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.camera-preview {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.camera-preview video,
.camera-preview img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.camera-controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  padding: 20px;
  background: rgba(0,0,0,0.8);
}

.camera-error {
  color: #ff4757;
  text-align: center;
  padding: 20px;
  background: rgba(0,0,0,0.8);
}

/* 全屏表单 */
.form-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #f5f5f5;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-header h2 {
  margin: 0;
  font-size: 18px;
}

.form-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.type-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.type-btn {
  flex: 1;
  padding: 15px;
  border: 2px solid #ddd;
  border-radius: 10px;
  background: white;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.type-btn.active {
  border-color: #667eea;
  background: #f0f3ff;
  color: #667eea;
}

.numbers-section {
  background: white;
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 20px;
}

.number-row {
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.number-row:last-of-type {
  margin-bottom: 10px;
  padding-bottom: 0;
  border-bottom: none;
}

.number-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
}

.remove-btn {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: #ff4757;
  color: white;
  font-size: 16px;
  cursor: pointer;
}

.number-inputs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.input-group {
  display: flex;
  gap: 5px;
}

.input-group input {
  width: 40px;
  height: 40px;
  border: 1px solid #ddd;
  border-radius: 8px;
  text-align: center;
  font-size: 16px;
}

.input-group.red input {
  border-color: #ff6b6b;
  color: #ff4757;
}

.input-group.blue input {
  border-color: #4dabf7;
  color: #228be6;
}

.input-group.front input {
  border-color: #ff6b6b;
  color: #ff4757;
}

.input-group.back input {
  border-color: #4dabf7;
  color: #228be6;
}

.add-number-btn {
  width: 100%;
  padding: 12px;
  border: 2px dashed #ddd;
  border-radius: 8px;
  background: transparent;
  color: #666;
  font-size: 14px;
  cursor: pointer;
}

.options-section {
  background: white;
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 20px;
}

.option-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.option-row:last-child {
  margin-bottom: 0;
}

.option-row label {
  font-size: 14px;
  color: #333;
  margin-right: 15px;
  white-space: nowrap;
}

.multiple-selector {
  display: flex;
  gap: 8px;
  align-items: center;
}

.multiple-btn {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: white;
  font-size: 12px;
  cursor: pointer;
}

.multiple-btn.active {
  border-color: #667eea;
  background: #667eea;
  color: white;
}

.multiple-input {
  width: 50px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  text-align: center;
  font-size: 12px;
}

.toggle-btn {
  padding: 8px 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: white;
  font-size: 12px;
  cursor: pointer;
}

.toggle-btn.active {
  border-color: #2ed573;
  background: #2ed573;
  color: white;
}

.summary-section {
  background: white;
  border-radius: 12px;
  padding: 15px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-row.total {
  font-size: 18px;
  font-weight: bold;
  color: #667eea;
}

/* 模态框 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal {
  background: white;
  border-radius: 12px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal h2 {
  margin-bottom: 20px;
}

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

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #888;
}

.empty-state svg {
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
  opacity: 0.5;
}

/* 加载状态 */
.loading {
  text-align: center;
  padding: 40px;
  color: #888;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f0f0f0;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

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

/* 底部导航 */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  display: flex;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  z-index: 100;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #999;
  transition: color 0.2s;
}

.nav-item.active {
  color: #667eea;
}

.nav-icon {
  font-size: 24px;
  margin-bottom: 4px;
}

.nav-label {
  font-size: 12px;
}

/* 我的页面 */
.mine-page {
  padding-top: 20px;
}

.user-info-card {
  background: white;
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.user-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 36px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px;
}

.user-name {
  font-size: 20px;
  font-weight: 500;
  color: #333;
}

.mine-actions {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.mine-btn {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 18px 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  color: #333;
  border-bottom: 1px solid #eee;
  transition: background 0.2s;
}

.mine-btn:last-child {
  border-bottom: none;
}

.mine-btn:hover {
  background: #f9f9f9;
}

.mine-btn.logout {
  color: #ff4757;
}

.mine-btn-icon {
  font-size: 20px;
  margin-right: 15px;
}

/* 操作按钮 */
.action-btn {
  flex: 1;
  padding: 18px 8px;
  font-size: 13px;
  white-space: nowrap;
}

/* 详情页 */
.detail-page {
  min-height: 100vh;
  background: #f5f5f5;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.detail-header h2 {
  margin: 0;
  font-size: 18px;
}

.detail-content {
  padding: 20px;
}

.detail-card {
  background: white;
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 15px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.detail-card-title {
  font-size: 14px;
  color: #666;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  color: #888;
  font-size: 14px;
}

.detail-value {
  color: #333;
  font-size: 14px;
  font-weight: 500;
}

.detail-value.expense {
  color: #ff4757;
}

.detail-value.income {
  color: #2ed573;
}

.number-display {
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #f0f0f0;
}

.number-display:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.number-index {
  display: block;
  font-size: 12px;
  color: #888;
  margin-bottom: 8px;
}

.number-balls {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ball {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  color: white;
}

.ball.red {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
}

.ball.blue {
  background: linear-gradient(135deg, #4dabf7 0%, #339af0 100%);
}

.ticket-item {
  cursor: pointer;
  transition: background 0.2s;
}

.ticket-item:hover {
  background: #f9f9f9;
}

/* 筛选区域 */
.filter-section {
  background: white;
  border-radius: 12px;
  padding: 15px;
  margin: 15px 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.filter-group {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-label {
  font-size: 13px;
  color: #888;
  margin-right: 10px;
  white-space: nowrap;
}

.filter-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-tag {
  padding: 5px 12px;
  border: 1px solid #ddd;
  border-radius: 16px;
  background: white;
  font-size: 12px;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-tag.active {
  border-color: #667eea;
  background: #667eea;
  color: white;
}

/* Toast 提示 */
.toast-container {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 14px;
  color: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.2s forwards;
}

.toast-success { background: #2ed573; }
.toast-error { background: #ff4757; }
.toast-info { background: #667eea; }

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

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

/* 换一注按钮 */
.refresh-one-btn {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: #f0f0f0;
  color: #666;
  font-size: 14px;
  cursor: pointer;
  margin-left: 8px;
  flex-shrink: 0;
  transition: background 0.2s;
}

.refresh-one-btn:active {
  background: #ddd;
}
