/* 住客端移动端样式 - 375px 基准宽度 */

:root {
  --primary: #a64b2a;
  --primary-light: #f3dfd6;
  --primary-dark: #7a341d;
  --bg: #f4efe7;
  --surface: #fffdf9;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e7dccd;
  --success: #1f7a4f;
  --success-light: #dff3e8;
  --warning: #a14c16;
  --warning-light: #f8e4d6;
  --error: #dc2626;
  --error-light: #fee2e2;
  --shadow: 0 4px 20px rgba(72, 43, 26, 0.08);
}

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

body.guest-mobile {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.guest-container {
  max-width: 430px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
}

/* 头部 */
.guest-header {
  padding: 24px 0 16px;
  text-align: center;
}

.guest-header.compact {
  padding: 12px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.back-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 8px 0;
}

.guest-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  flex: 1;
}

.subtitle {
  color: var(--muted);
  font-size: 15px;
  margin-top: 4px;
}

/* 进行中任务提醒 */
.active-tasks-section {
  margin-bottom: 16px;
}

.active-task-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
}

.task-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.task-type {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  background: var(--primary-light);
  padding: 4px 10px;
  border-radius: 20px;
}

.task-status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
}

.task-status.pending {
  background: var(--warning-light);
  color: var(--warning);
}

.task-status.in_progress {
  background: #dbeafe;
  color: #1e40af;
}

.task-status.completed {
  background: var(--success-light);
  color: var(--success);
}

.task-desc {
  font-size: 15px;
  color: var(--ink);
  line-height: 1.5;
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.task-time {
  font-size: 12px;
  color: var(--muted);
}

/* 常用服务快捷入口 */
.quick-services {
  margin-bottom: 24px;
}

.quick-services h2 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--ink);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.service-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease;
}

.service-card:active {
  transform: scale(0.96);
}

.service-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.service-name {
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
}

/* 主要功能入口 */
.main-actions {
  margin-bottom: 24px;
}

.action-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  margin-bottom: 12px;
  text-decoration: none;
  color: inherit;
  transition: all 0.15s ease;
}

.action-card:active {
  background: #f9f7f4;
}

.action-card.primary {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--surface) 0%, var(--primary-light) 100%);
}

.action-icon {
  font-size: 28px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: 14px;
}

.action-content {
  flex: 1;
}

.action-content strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

.action-content span {
  font-size: 13px;
  color: var(--muted);
}

.action-arrow {
  font-size: 20px;
  color: var(--muted);
}

/* 进度入口 */
.progress-section {
  margin-bottom: 24px;
}

.progress-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
}

.progress-link .arrow {
  font-size: 20px;
  color: var(--muted);
}

/* 表单样式 */
.form-section {
  margin-bottom: 20px;
}

.form-section h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--ink);
}

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

.form-label .required {
  color: var(--error);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 15px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
}

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

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

.char-count {
  display: block;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

/* 类型选择卡片 */
.type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.type-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.type-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

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

.type-card strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

.type-desc,
.type-examples {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* 维修类型卡片 */
.repair-card,
.complaint-card {
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
}

.repair-card .type-icon,
.complaint-card .type-icon {
  font-size: 28px;
  margin-bottom: 0;
}

.type-info {
  flex: 1;
}

.type-info strong {
  display: block;
  margin-bottom: 4px;
}

/* 数量选择器 */
.quantity-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.qty-btn {
  flex: 1;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

/* 紧急程度选择 */
.urgency-selector {
  display: flex;
  gap: 10px;
}

.urgency-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.urgency-btn.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.urgency-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.urgency-dot.normal {
  background: var(--success);
}

.urgency-dot.urgent {
  background: var(--warning);
}

.urgency-dot.emergency {
  background: var(--error);
}

/* 安抚横幅 */
.comfort-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #bbf7d0;
  border-radius: 14px;
  margin-bottom: 20px;
}

.comfort-icon {
  font-size: 24px;
}

.comfort-banner p {
  font-size: 14px;
  color: #166534;
  line-height: 1.5;
}

/* 提交按钮 */
.submit-section {
  margin-top: 32px;
}

.submit-btn {
  width: 100%;
  padding: 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.submit-btn:active {
  transform: scale(0.98);
}

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

.submit-tip {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 12px;
}

/* 弹窗 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 100;
}

.modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--surface);
  border-radius: 20px;
  padding: 32px 24px;
  width: 100%;
  max-width: 320px;
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.2s ease;
}

.modal.show .modal-content {
  transform: scale(1);
}

.modal-icon {
  display: block;
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: var(--success);
  color: white;
  font-size: 32px;
  line-height: 64px;
  border-radius: 50%;
}

.modal-content h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.modal-content p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.modal-btn {
  padding: 14px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.modal-btn.secondary {
  background: var(--bg);
  color: var(--ink);
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.modal-actions .modal-btn {
  flex: 1;
}

/* 筛选标签 */
.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter-tab {
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* 任务列表页 */
.task-list-section {
  min-height: 200px;
}

.task-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.task-card:active {
  transform: scale(0.98);
}

.task-card.timeout,
.task-card.escalated {
  border-color: var(--error);
  background: var(--error-light);
}

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

.task-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.task-room {
  font-size: 13px;
  color: var(--muted);
}

.task-done-badge {
  display: inline-block;
  padding: 4px 10px;
  background: var(--success-light);
  color: var(--success);
  font-size: 12px;
  border-radius: 20px;
}

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

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

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 20px;
}

.empty-action {
  padding: 12px 24px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 500;
}

/* 加载状态 */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}

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

.loading-text {
  color: var(--muted);
  font-size: 14px;
}

/* 任务详情弹窗 */
.task-detail-modal .modal-content {
  max-width: 360px;
  max-height: 80vh;
  overflow-y: auto;
  text-align: left;
  padding: 0;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg);
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
}

.task-detail-header {
  display: flex;
  gap: 10px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.task-type-badge,
.task-status-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.task-type-badge {
  background: var(--primary-light);
  color: var(--primary);
}

.task-status-badge.pending {
  background: var(--warning-light);
  color: var(--warning);
}

.task-status-badge.in_progress {
  background: #dbeafe;
  color: #1e40af;
}

.task-status-badge.completed {
  background: var(--success-light);
  color: var(--success);
}

.task-detail-info {
  padding: 20px 24px;
}

.task-detail-info p {
  margin-bottom: 12px;
  font-size: 14px;
}

.task-detail-info strong {
  color: var(--muted);
  font-weight: 500;
}

.task-timeline {
  padding: 20px 24px;
  border-top: 1px solid var(--line);
}

.task-timeline h4 {
  font-size: 15px;
  margin-bottom: 16px;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.timeline-item {
  display: flex;
  gap: 12px;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}

.timeline-content p {
  font-size: 14px;
  margin-bottom: 4px;
}

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

/* 反馈按钮 */
.task-feedback {
  padding: 20px 24px;
  border-top: 1px solid var(--line);
}

.task-feedback h4 {
  font-size: 15px;
  margin-bottom: 16px;
}

.feedback-buttons {
  display: flex;
  gap: 10px;
}

.feedback-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s ease;
}

.feedback-btn span {
  font-size: 24px;
}

.feedback-btn:active {
  background: var(--bg);
}

/* 错误状态 */
.error-state {
  text-align: center;
  padding: 48px 24px;
}

.error-state p {
  color: var(--muted);
  margin-bottom: 16px;
}

.retry-btn {
  padding: 12px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
}

/* 智能分诊标签样式 */
.task-triage {
  background: var(--success-light);
  border-left: 3px solid var(--success);
  padding: 10px 12px;
  border-radius: 8px;
  margin: 10px 0;
}

.triage-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--success);
  display: block;
  margin-bottom: 4px;
}

.triage-summary {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.4;
}

/* 结构化结果展示样式 */
.task-structured-result {
  background: var(--primary-light);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 10px 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.result-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.result-summary {
  font-size: 13px;
  color: var(--primary-dark);
  line-height: 1.4;
}

/* 详情页智能分诊区域 */
.task-detail-triage,
.task-detail-result {
  padding: 20px 24px;
  border-top: 1px solid var(--line);
  background: linear-gradient(to right, #f8fff9, #ffffff);
}

.task-detail-triage h4,
.task-detail-result h4 {
  font-size: 15px;
  margin-bottom: 12px;
}

.task-detail-triage p,
.task-detail-result p {
  font-size: 14px;
  margin-bottom: 8px;
  line-height: 1.5;
}

.task-detail-triage strong,
.task-detail-result strong {
  color: var(--muted);
  font-weight: 500;
}

/* 情绪分析指示器 */
.sentiment-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  transition: all 0.3s ease;
}

.sentiment-indicator.sentiment-positive {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #bbf7d0;
}

.sentiment-indicator.sentiment-neutral {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #fcd34d;
}

.sentiment-indicator.sentiment-negative {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border: 1px solid #fca5a5;
}

.sentiment-icon {
  font-size: 20px;
}

.sentiment-text {
  font-size: 14px;
  color: var(--ink);
}

.sentiment-positive .sentiment-text {
  color: #166534;
}

.sentiment-neutral .sentiment-text {
  color: #92400e;
}

.sentiment-negative .sentiment-text {
  color: #991b1b;
}

/* 拦截弹窗样式 */
.modal-content.intercept {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border: 1px solid #fed7aa;
}

.modal-icon.warning {
  background: var(--warning);
}

.intercept-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.intercept-btn {
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.intercept-btn.primary {
  background: linear-gradient(135deg, var(--warning) 0%, #c2410c 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(161, 76, 22, 0.3);
}

.intercept-btn.secondary {
  background: rgba(0, 0, 0, 0.05);
  color: var(--muted);
}

.intercept-btn:not(.secondary):active {
  transform: scale(0.98);
}
