/* 通用报修系统 - 样式文件 */

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

:root {
  --primary: #1890ff;
  --success: #52c41a;
  --warning: #faad14;
  --error: #ff4d4f;
  --text-primary: #333;
  --text-secondary: #666;
  --text-disabled: #999;
  --border: #e8e8e8;
  --bg: #f5f5f5;
  --bg-white: #fff;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* 容器 */
.container {
  max-width: 750px;
  margin: 0 auto;
  padding: 0 16px;
}

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

/* 按钮 */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: all 0.3s;
}

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

.btn-primary:hover {
  background: #40a9ff;
}

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

.btn-success:hover {
  background: #73d13d;
}

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

.btn-danger:hover {
  background: #ff7875;
}

.btn-warning {
  background: #faad14;
  color: #fff;
}

.btn-warning:hover {
  background: #ffc53d;
}

.status-cancelled {
  background: #f5f5f5;
  color: #999;
}

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

.btn-warning:hover {
  background: #ffc53d;
}

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

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

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-label.required::after {
  content: ' *';
  color: var(--error);
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.3s;
}

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

textarea.form-input {
  min-height: 100px;
  resize: vertical;
}

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

.status-pending {
  background: #fff7e6;
  color: #fa8c16;
}

.status-processing {
  background: #e6f7ff;
  color: #1890ff;
}

.status-completed {
  background: #f6ffed;
  color: #52c41a;
}

.status-confirmed {
  background: #d9f7be;
  color: #389e0d;
}

/* 头部 */
.header {
  background: var(--primary);
  color: #fff;
  padding: 16px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.header-back {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  text-decoration: none;
  font-size: 14px;
}

/* 列表 */
.list-item {
  padding: 16px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
}

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

.list-item-title {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.list-item-meta {
  font-size: 13px;
  color: var(--text-secondary);
}

/* 照片上传 */
.photo-upload {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.3s;
}

.photo-upload:hover {
  border-color: var(--primary);
}

.photo-upload-icon {
  font-size: 32px;
  color: var(--text-disabled);
  margin-bottom: 8px;
}

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

.photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.photo-preview-item {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 4px;
  overflow: hidden;
}

.photo-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-preview-delete {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 时间线 */
.timeline {
  padding: 16px 0;
}

.timeline-item {
  display: flex;
  padding-bottom: 16px;
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 20px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-right: 12px;
  position: relative;
  z-index: 1;
}

.timeline-content {
  flex: 1;
}

.timeline-title {
  font-weight: 500;
  margin-bottom: 4px;
}

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

.timeline-note {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 14px;
}

/* 照片展示 */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.photo-gallery img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-secondary);
}

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

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

/* 底部导航 */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-white);
  display: flex;
  border-top: 1px solid var(--border);
  max-width: 750px;
  margin: 0 auto;
}

.bottom-nav-item {
  flex: 1;
  padding: 8px 0;
  text-align: center;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 12px;
}

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

.bottom-nav-item i {
  display: block;
  font-size: 20px;
  margin-bottom: 4px;
}

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

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--bg-white);
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 16px;
}

.modal-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Toast提示 */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 12px 24px;
  border-radius: 4px;
  z-index: 2000;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* 登录页面 */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, var(--primary) 0%, #0050b3 100%);
}

.login-header {
  padding: 48px 16px;
  text-align: center;
  color: #fff;
}

.login-header h1 {
  font-size: 28px;
  margin-bottom: 8px;
}

.login-header p {
  opacity: 0.8;
  font-size: 14px;
}

.login-form {
  flex: 1;
  padding: 24px 16px;
}

.login-card {
  background: var(--bg-white);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.login-tabs {
  display: flex;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
}

.login-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.3s;
}

.login-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* 修复单详情 */
.repair-detail {
  padding-bottom: 80px;
}

.repair-detail-header {
  background: var(--primary);
  color: #fff;
  padding: 20px 16px;
}

.repair-detail-status {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}

.repair-detail-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  font-size: 14px;
  opacity: 0.9;
}

.repair-section {
  padding: 16px;
  background: var(--bg-white);
  margin-bottom: 12px;
}

.repair-section-title {
  font-weight: 500;
  margin-bottom: 12px;
  color: var(--text-primary);
}

/* 响应式 */
@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }

  .card {
    padding: 12px;
  }
}
