/* assets/style.css - 全站样式 */

:root {
  --bg: #f5f6fa;
  --card: #ffffff;
  --primary: #1677ff;
  --primary-dark: #0958d9;
  --success: #52c41a;
  --warning: #faad14;
  --danger: #ff4d4f;
  --text: #1f1f1f;
  --text-2: #595959;
  --text-3: #8c8c8c;
  --border: #e5e7eb;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', 
               'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--primary); text-decoration: none; }

/* ===== 布局 ===== */
.container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: 80px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(135deg, #1677ff 0%, #0958d9 100%);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  flex: 1;
}

.header .back {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  margin-left: -8px;
}
.header .back:active { background: rgba(255,255,255,0.15); }

/* ===== 通用 ===== */
.section {
  padding: 16px;
}
.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px;
  padding-left: 8px;
  border-left: 3px solid var(--primary);
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
}

.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
}

.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-3);
}

/* ===== 服务列表 ===== */
.category {
  margin-bottom: 16px;
}
.category-name {
  display: flex;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
  margin: 16px 16px 12px;
}
.category-name::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 16px;
  background: var(--primary);
  border-radius: 2px;
  margin-right: 8px;
}

.service-list {
  padding: 0 12px;
}
.service-item {
  background: #fff;
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  gap: 12px;
  box-shadow: var(--shadow);
  transition: transform 0.15s;
  cursor: pointer;
}
.service-item:active {
  transform: scale(0.98);
}
.service-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: linear-gradient(135deg, #e6f4ff, #bae0ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.service-info {
  flex: 1;
  min-width: 0;
}
.service-name {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 4px;
}
.service-desc {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.service-price {
  display: flex;
  align-items: baseline;
  margin-top: 4px;
  color: var(--danger);
}
.service-price .currency { font-size: 12px; }
.service-price .amount { font-size: 18px; font-weight: 600; margin: 0 1px; }
.service-price .unit { font-size: 12px; color: var(--text-3); }

/* ===== 表单 ===== */
.form-group {
  background: #fff;
  margin-bottom: 12px;
  border-radius: var(--radius);
  overflow: hidden;
}
.form-row {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.form-row:last-child { border-bottom: none; }
.form-label {
  width: 80px;
  flex-shrink: 0;
  font-size: 14px;
  color: var(--text-2);
}
.form-label.required::after {
  content: '*';
  color: var(--danger);
  margin-left: 2px;
}
.form-input,
.form-textarea {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--text);
  background: transparent;
  padding: 0;
  font-family: inherit;
}
.form-textarea {
  min-height: 60px;
  resize: vertical;
  padding-top: 4px;
}
.form-row.column {
  flex-direction: column;
  align-items: stretch;
}
.form-row.column .form-label {
  width: auto;
  margin-bottom: 8px;
}

/* ===== 按钮 ===== */
.btn {
  display: block;
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
  font-family: inherit;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(135deg, #1677ff, #0958d9);
  color: #fff;
}
.btn-primary:disabled {
  background: #bfbfbf;
  cursor: not-allowed;
}
.btn-secondary {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  max-width: 480px;
  margin: 0 auto;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
}

/* ===== 订单状态 ===== */
.status-tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}
.status-pending_pay { background: #fff7e6; color: #faad14; }
.status-paid { background: #e6f4ff; color: #1677ff; }
.status-processing { background: #f6ffed; color: #52c41a; }
.status-completed { background: #f0f0f0; color: #8c8c8c; }
.status-cancelled { background: #fff1f0; color: #ff4d4f; }

/* ===== 支付页 ===== */
.pay-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  margin: 16px;
  box-shadow: var(--shadow);
}
.pay-amount {
  font-size: 32px;
  font-weight: 600;
  color: var(--danger);
  margin: 16px 0 8px;
}
.pay-amount .currency { font-size: 18px; vertical-align: top; }
.pay-tip {
  color: var(--text-3);
  font-size: 13px;
  margin-bottom: 20px;
}
.qr-wrap {
  display: inline-block;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin: 12px 0;
}
.qr-wrap img {
  display: block;
  width: 220px;
  height: 220px;
}
.pay-instructions {
  text-align: left;
  background: #fffbe6;
  border-left: 3px solid var(--warning);
  padding: 12px 16px;
  margin: 16px;
  border-radius: 6px;
  font-size: 13px;
  color: #614700;
  line-height: 1.6;
}
.status-banner {
  padding: 16px;
  text-align: center;
  font-size: 14px;
}
.status-banner.success {
  background: #f6ffed;
  color: var(--success);
}
.status-banner.warning {
  background: #fffbe6;
  color: var(--warning);
}

/* ===== 订单卡片(我的订单页) ===== */
.order-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.order-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.order-no {
  font-size: 12px;
  color: var(--text-3);
  font-family: 'SF Mono', Menlo, monospace;
}
.order-body {
  font-size: 14px;
  margin: 6px 0;
}
.order-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-3);
}
.order-amount {
  color: var(--danger);
  font-weight: 600;
  font-size: 15px;
}

/* ===== 弹窗 ===== */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 1000;
  pointer-events: none;
  white-space: nowrap;
  max-width: 80%;
  text-align: center;
  animation: toast-in 0.2s;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, -40%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

/* ===== 管理后台 ===== */
.admin-body {
  background: #f0f2f5;
}
.admin-tabs {
  display: flex;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 9;
  overflow-x: auto;
}
.admin-tab {
  flex-shrink: 0;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.admin-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 500;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px;
}
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.stat-label {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 6px;
}
.stat-value {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}
.stat-value.danger { color: var(--danger); }
.stat-value.primary { color: var(--primary); }
.stat-value.warning { color: var(--warning); }

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal-body {
  background: #fff;
  width: 100%;
  max-width: 480px;
  border-radius: 16px 16px 0 0;
  max-height: 80vh;
  overflow-y: auto;
}
.modal-head {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
  position: sticky;
  top: 0;
  background: #fff;
}
.modal-content {
  padding: 16px;
}
