/* 瑶池足浴 - 技师工资结算系统 */
:root {
  --primary: #e74c3c;
  --primary-dark: #c0392b;
  --primary-light: #ff6b6b;
  --secondary: #2c3e50;
  --accent: #f39c12;
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #2c3e50;
  --text-light: #7f8c8d;
  --border: #e0e0e0;
  --success: #27ae60;
  --danger: #e74c3c;
  --warning: #f39c12;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --radius: 12px;
}

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

html {
  height: 100%;
  background-color: #f5f6fa;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100%;
}

/* 顶部导航 */
.header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(231,76,60,0.3);
}

.header h1 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 1px;
}

.header .back-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
}

.header .back-btn.visible {
  display: block;
}

/* 底部导航 */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  display: flex;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav .nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: var(--text-light);
  border: none;
  background: none;
  font-family: inherit;
}

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

.bottom-nav .nav-item .nav-icon {
  font-size: 22px;
  margin-bottom: 2px;
}

.bottom-nav .nav-item .nav-label {
  font-size: 11px;
}

/* 页面容器 */
.page {
  display: none;
  padding: 16px;
  padding-bottom: 120px;
  min-height: 100%;
}

.page.active {
  display: block;
}

/* 卡片 */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

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

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

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

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

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

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

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}

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

.btn-block {
  width: 100%;
  display: flex;
}

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* 表单 */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-light);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
  background: white;
  -webkit-appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237f8c8d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group {
  flex: 1;
}

/* 列表 */
.list-item {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

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

.list-item .item-info {
  flex: 1;
}

.list-item .item-name {
  font-size: 15px;
  font-weight: 500;
}

.list-item .item-detail {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}

.list-item .item-actions {
  display: flex;
  gap: 8px;
}

/* 标签 */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.tag-primary { background: #ffe0e0; color: var(--primary); }
.tag-success { background: #e0f7e0; color: var(--success); }
.tag-warning { background: #fff3e0; color: var(--warning); }
.tag-info { background: #e0f0ff; color: #3498db; }

/* 搜索框 */
.search-box {
  position: relative;
  margin-bottom: 12px;
}

.search-box input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: white;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
}

.search-box::before {
  content: '🔍';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
}

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

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--card);
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 20px;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-header h3 {
  font-size: 17px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-light);
  padding: 4px;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 14px;
}

/* 统计卡片 */
.stat-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  text-align: center;
}

.stat-card .stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

/* Tab切换 */
.tabs {
  display: flex;
  background: white;
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.tab-item {
  flex: 1;
  padding: 8px;
  text-align: center;
  border: none;
  background: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-light);
  transition: all 0.2s;
}

.tab-item.active {
  background: var(--primary);
  color: white;
  font-weight: 500;
}

/* 日期选择 */
.date-range {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.date-range input[type="date"] {
  flex: 1;
  padding: 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
}

.date-range span {
  color: var(--text-light);
  font-size: 13px;
}

/* 工资明细 */
.salary-item {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}

.salary-item .salary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.salary-item .salary-name {
  font-size: 15px;
  font-weight: 600;
}

.salary-item .salary-total {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.salary-item .salary-detail {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.6;
}

/* 批量录入表格 */
.batch-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

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

.batch-table th {
  background: var(--bg);
  font-weight: 500;
  color: var(--text-light);
  font-size: 11px;
}

.batch-table td select,
.batch-table td input {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
}

/* 提成设置行 */
.commission-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

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

.commission-row .service-name {
  flex: 1;
  font-size: 14px;
}

.commission-row .commission-input {
  width: 80px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  text-align: center;
}

/* 结算周期选择 */
.period-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.period-btn {
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: white;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.period-btn.active {
  border-color: var(--primary);
  background: #fff0f0;
  color: var(--primary);
  font-weight: 500;
}

/* 文件上传 */
.file-upload {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 12px;
}

.file-upload:active {
  border-color: var(--primary);
  background: #fff8f8;
}

.file-upload .upload-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.file-upload p {
  font-size: 13px;
  color: var(--text-light);
}

/* Toast提示 */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--secondary);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 300;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }

/* 滚动条美化 */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

/* 响应式 */
@media (min-width: 480px) {
  .page { max-width: 480px; margin: 0 auto; }
  .bottom-nav { max-width: 480px; left: 50%; transform: translateX(-50%); }
  .header { max-width: 480px; margin: 0 auto; }
}

/* 动画 */
.fade-in {
  animation: fadeIn 0.3s ease;
}

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

/* 删除确认 */
.confirm-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 250;
  justify-content: center;
  align-items: center;
}

.confirm-overlay.active {
  display: flex;
}

.confirm-box {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  width: 280px;
  text-align: center;
}

.confirm-box p {
  margin-bottom: 20px;
  font-size: 15px;
}

.confirm-box .btn-group {
  justify-content: center;
}

/* 订单卡片 */
.order-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}

.order-card .order-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.order-card .order-tech {
  font-size: 15px;
  font-weight: 600;
}

.order-card .order-time {
  font-size: 12px;
  color: var(--text-light);
}

.order-card .order-services {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.6;
}

.order-card .order-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.order-card .order-price {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
}

.order-card .order-commission {
  font-size: 12px;
  color: var(--success);
}
