/* ============================================
   东半球超跑 — 工单系统样式
   配合 unified-layout.css 使用
   ============================================ */

/* ===== 页面容器 ===== */
.order-page {
  min-height: calc(100vh - 60px);
  background: var(--bg, #0a0a0a);
  padding: 2.5rem 1.5rem;
}

.order-page-inner {
  max-width: 780px;
  margin: 0 auto;
}

.order-page-inner--wide {
  max-width: 1100px;
}

/* ===== 页面标题区 ===== */
.page-hero {
  text-align: center;
  padding: 1.5rem 0 2.5rem;
}

.page-hero h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold, #c8a45c);
  margin: 0 0 0.5rem;
  letter-spacing: 0.02em;
}

.page-hero p {
  color: var(--text-muted, #999);
  font-size: 0.95rem;
  margin: 0;
}

/* ===== 表单样式 ===== */
.form-section {
  background: var(--card, #1e1e1e);
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.form-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold, #c8a45c);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border, #2a2a2a);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group--full {
  grid-column: 1 / -1;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted, #999);
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.form-label .required {
  color: var(--danger, #EF4444);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: var(--surface, #1a1a1a);
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 8px;
  color: var(--text, #e0e0e0);
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--gold, #c8a45c);
  box-shadow: 0 0 0 3px rgba(200, 164, 92, 0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-dim, #666);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.2rem;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.4rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--gold, #c8a45c), var(--gold-dark, #a88a3c));
  color: #000;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--gold-light, #e5c878), var(--gold, #c8a45c));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(200, 164, 92, 0.3);
}

.btn-secondary {
  background: var(--surface, #1a1a1a);
  color: var(--text, #e0e0e0);
  border: 1px solid var(--border, #2a2a2a);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--gold, #c8a45c);
  color: var(--gold, #c8a45c);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger, #EF4444);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.25);
}

.btn-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success, #10B981);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-success:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.25);
}

.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.85rem 2rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

/* ===== 状态标签 ===== */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-quoted {
  background: rgba(59, 130, 246, 0.15);
  color: #3B82F6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-confirmed {
  background: rgba(139, 92, 246, 0.15);
  color: #8B5CF6;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.status-repairing {
  background: rgba(200, 164, 92, 0.15);
  color: var(--gold, #c8a45c);
  border: 1px solid rgba(200, 164, 92, 0.3);
}

.status-completed {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-settled {
  background: rgba(16, 185, 129, 0.25);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.status-cancelled {
  background: rgba(107, 114, 128, 0.15);
  color: #9CA3AF;
  border: 1px solid rgba(107, 114, 128, 0.3);
}

/* ===== 卡片 ===== */
.card {
  background: var(--card, #1e1e1e);
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 12px;
  padding: 1.25rem;
  transition: border-color 0.2s;
}

.card:hover {
  border-color: var(--border-light, #333);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text, #e0e0e0);
  margin: 0;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--text-muted, #999);
}

/* ===== 工单列表 ===== */
.order-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.order-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--card, #1e1e1e);
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
}

.order-item:hover {
  border-color: var(--gold, #c8a45c);
  transform: translateX(4px);
}

.order-item-left {
  flex: 1;
  min-width: 0;
}

.order-item-no {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text, #e0e0e0);
  margin-bottom: 0.3rem;
}

.order-item-info {
  font-size: 0.8rem;
  color: var(--text-muted, #999);
}

.order-item-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* ===== 登录区域 ===== */
.login-section {
  max-width: 400px;
  margin: 3rem auto;
  text-align: center;
}

.login-section .form-section {
  padding: 2rem;
}

.login-section h2 {
  color: var(--gold, #c8a45c);
  font-size: 1.2rem;
  margin: 0 0 0.5rem;
}

.login-section p {
  color: var(--text-muted, #999);
  font-size: 0.85rem;
  margin: 0 0 1.5rem;
}

/* ===== 工单详情 ===== */
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.detail-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text, #e0e0e0);
  margin: 0;
}

.detail-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted, #999);
  margin: 0.3rem 0 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.detail-info-group {
  padding: 1rem;
  background: var(--surface, #1a1a1a);
  border-radius: 8px;
}

.detail-info-label {
  font-size: 0.75rem;
  color: var(--text-dim, #666);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}

.detail-info-value {
  font-size: 0.9rem;
  color: var(--text, #e0e0e0);
  font-weight: 500;
}

/* ===== 报价表 ===== */
.quote-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.quote-table th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted, #999);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border, #2a2a2a);
}

.quote-table td {
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text, #e0e0e0);
  border-bottom: 1px solid var(--border, #2a2a2a);
}

.quote-total {
  display: flex;
  justify-content: flex-end;
  padding: 0.75rem 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold, #c8a45c);
}

/* ===== 进度步骤条 ===== */
.stepper {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  position: relative;
  padding: 0 0.5rem;
}

.stepper::before {
  content: '';
  position: absolute;
  top: 16px;
  left: 24px;
  right: 24px;
  height: 2px;
  background: var(--border, #2a2a2a);
  z-index: 0;
}

.stepper-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
}

.stepper-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  transition: all 0.3s;
  border: 2px solid var(--border, #2a2a2a);
  background: var(--card, #1e1e1e);
  color: var(--text-dim, #666);
}

.stepper-step.completed .stepper-circle {
  background: var(--gold, #c8a45c);
  border-color: var(--gold, #c8a45c);
  color: #000;
}

.stepper-step.active .stepper-circle {
  background: transparent;
  border-color: var(--gold, #c8a45c);
  color: var(--gold, #c8a45c);
  box-shadow: 0 0 0 4px rgba(200, 164, 92, 0.2);
  animation: stepperPulse 2s ease-in-out infinite;
}

@keyframes stepperPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(200, 164, 92, 0.2); }
  50% { box-shadow: 0 0 0 8px rgba(200, 164, 92, 0.1); }
}

.stepper-step.cancelled .stepper-circle {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--danger, #EF4444);
  color: var(--danger, #EF4444);
}

.stepper-label {
  font-size: 0.7rem;
  color: var(--text-dim, #666);
  text-align: center;
  line-height: 1.3;
  max-width: 64px;
  word-break: keep-all;
}

.stepper-step.completed .stepper-label {
  color: var(--gold, #c8a45c);
}

.stepper-step.active .stepper-label {
  color: var(--text, #e0e0e0);
  font-weight: 600;
}

.stepper-time {
  font-size: 0.65rem;
  color: var(--text-dim, #666);
  text-align: center;
  margin-top: 0.2rem;
}

/* ===== 进度时间轴 ===== */
.timeline {
  position: relative;
  padding-left: 1.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border, #2a2a2a);
}

.timeline-item {
  position: relative;
  padding-bottom: 1.25rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -1.5rem;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold, #c8a45c);
  border: 2px solid var(--bg, #0a0a0a);
}

.timeline-dot--muted {
  background: var(--border, #2a2a2a);
}

.timeline-dot--active {
  background: var(--gold, #c8a45c);
  box-shadow: 0 0 0 4px rgba(200, 164, 92, 0.25);
}

.timeline-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text, #e0e0e0);
  margin-bottom: 0.2rem;
}

.timeline-desc {
  font-size: 0.8rem;
  color: var(--text-muted, #999);
}

.timeline-time {
  font-size: 0.75rem;
  color: var(--text-dim, #666);
  margin-top: 0.2rem;
}

/* ===== 维修进度条 ===== */
.progress-bar-wrap {
  background: var(--surface, #1a1a1a);
  border-radius: 8px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--gold, #c8a45c), #d4af6a);
  transition: width 0.6s ease;
}

.progress-text {
  font-size: 0.8rem;
  color: var(--text-muted, #999);
  text-align: right;
}

/* ===== 操作日志 ===== */
.log-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.log-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border, #2a2a2a);
  font-size: 0.8rem;
}

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

.log-action {
  color: var(--gold, #c8a45c);
  font-weight: 600;
  flex-shrink: 0;
  min-width: 70px;
}

.log-note {
  color: var(--text-muted, #999);
  flex: 1;
}

.log-time {
  color: var(--text-dim, #666);
  flex-shrink: 0;
}

/* ===== 统计卡片（管理后台） ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--card, #1e1e1e);
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 10px;
  padding: 1.25rem;
  text-align: center;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold, #c8a45c);
  line-height: 1;
  margin-bottom: 0.3rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted, #999);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== 筛选标签 ===== */
.filter-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border, #2a2a2a);
  background: transparent;
  color: var(--text-muted, #999);
  transition: all 0.2s;
}

.filter-tab:hover {
  border-color: var(--gold, #c8a45c);
  color: var(--gold, #c8a45c);
}

.filter-tab--active {
  background: var(--gold, #c8a45c);
  color: #000;
  border-color: var(--gold, #c8a45c);
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted, #999);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

/* ===== 加载状态 ===== */
.loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted, #999);
}

.loading-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--border, #2a2a2a);
  border-top-color: var(--gold, #c8a45c);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 0.5rem;
}

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

/* ===== Toast 提示 ===== */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
}

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

.toast--success {
  background: rgba(16, 185, 129, 0.9);
  color: #fff;
}

.toast--error {
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
}

.toast--info {
  background: rgba(59, 130, 246, 0.9);
  color: #fff;
}

/* ===== 操作栏 ===== */
.action-bar {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.action-bar--right {
  justify-content: flex-end;
}

.action-bar--center {
  justify-content: center;
}

/* ===== 分割线 ===== */
.divider {
  height: 1px;
  background: var(--border, #2a2a2a);
  margin: 1.25rem 0;
}

/* ===== 管理后台 - 报价编辑 ===== */
.quote-item-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 0.5rem;
  align-items: end;
  margin-bottom: 0.5rem;
}

.quote-item-row .form-group {
  margin-bottom: 0;
}

.quote-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border, #2a2a2a);
  margin-top: 1rem;
}

.quote-summary-row {
  display: flex;
  gap: 2rem;
  font-size: 0.85rem;
}

.quote-summary-label {
  color: var(--text-muted, #999);
}

.quote-summary-value {
  color: var(--text, #e0e0e0);
  font-weight: 500;
  min-width: 80px;
  text-align: right;
}

.quote-summary-row--total {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold, #c8a45c);
  padding-top: 0.5rem;
  border-top: 1px solid var(--border, #2a2a2a);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .order-page {
    padding: 1.5rem 1rem;
  }

  .page-hero h1 {
    font-size: 1.4rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .quote-item-row {
    grid-template-columns: 1fr 1fr;
  }

  .order-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .order-item-right {
    align-self: flex-end;
  }

  .action-bar {
    flex-direction: column;
  }

  .action-bar .btn {
    width: 100%;
  }

  .filter-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.5rem;
  }

  .filter-tab {
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-value {
    font-size: 1.4rem;
  }
}
