/* 工单列表 + 详情页共用样式 */

/* ===== 状态筛选 tab ===== */
.status-tabs {
  display: flex;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: sticky;
  top: 0;
  z-index: 10;
}

.tab {
  flex: 1;
  text-align: center;
  padding: 12px 6px;
  font-size: 14px;
  color: #666;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  transition: color 0.2s;
}

.tab.active {
  color: #2b6cb0;
  font-weight: 600;
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: #2b6cb0;
  border-radius: 2px;
}

/* ===== 工单列表 ===== */
.ticket-list {
  padding: 12px 16px 20px;
}

.ticket-card {
  display: block;
  background: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  text-decoration: none;
  color: #333;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: background 0.2s;
}

.ticket-card:active {
  background: #f7fafc;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  word-break: break-all;
  flex: 1;
}

.status-tag {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-tag.s-pending { background: #fed7d7; color: #c53030; }
.status-tag.s-accepted { background: #feebc8; color: #c05621; }
.status-tag.s-processing { background: #feebc8; color: #c05621; }
.status-tag.s-completed { background: #c6f6d5; color: #2f855a; }
.status-tag.s-empty { background: #e2e8f0; color: #718096; }

.card-row {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
  display: flex;
  gap: 6px;
}

.card-row .row-label {
  color: #a0aec0;
  flex-shrink: 0;
}

.card-row .row-value {
  flex: 1;
  word-break: break-all;
}

.empty {
  text-align: center;
  padding: 60px 20px;
  color: #a0aec0;
  font-size: 14px;
}

/* ===== 工单详情页 ===== */

/* 返回按钮 */
.header .back-btn {
  position: absolute;
  left: 12px;
  top: 14px;
  color: #fff;
  text-decoration: none;
  font-size: 20px;
  font-weight: 400;
}

/* 返回工作台按钮（详情页右上角） */
.header .home-btn {
  position: absolute;
  right: 12px;
  top: 14px;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  background: rgba(255, 255, 255, 0.18);
  padding: 4px 10px;
  border-radius: 12px;
}

/* 顶部工单卡片 */
.detail-hero {
  background: #fff;
  margin: 12px 16px 8px;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.hero-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  word-break: break-all;
  margin-bottom: 8px;
}

.hero-status {
  display: inline-block;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 10px;
}

/* 分组卡片 */
.detail-section {
  background: #fff;
  margin: 8px 16px;
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.section-name {
  font-size: 13px;
  font-weight: 600;
  color: #2b6cb0;
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid #edf2f7;
}

/* 字段行（紧凑布局：标签 + 值）—— 内容自适应，空值只占一行 */
.field-row {
  display: flex;
  padding: 4px 0;
  font-size: 14px;
  line-height: 1.5;
}

.field-label {
  color: #a0aec0;
  width: 84px;
  flex-shrink: 0;
  font-size: 13px;
  padding-top: 1px;
}

.field-value {
  color: #2d3748;
  flex: 1;
  word-break: break-all;
}

.field-value.empty {
  color: #cbd5e0;
  /* 覆盖 tickets.css 顶部通用 .empty { padding:60px 20px } 对本元素的误命中——
     否则空字段会被上下各 60px 撑成 141px，导致维修处理/费用结算 section 出现数百 px 空白 */
  padding: 0 !important;
  text-align: left !important;
}

/* 故障描述突出 */
.fault-card {
  background: #fffbf0;
  border-left: 3px solid #dd6b20;
}

.fault-card .field-value {
  font-weight: 500;
  color: #744210;
}

/* 费用金额 */
.fee-value {
  font-weight: 600;
  color: #2b6cb0;
}

.fee-total {
  color: #c53030;
  font-size: 16px;
}

/* 错误页 */
.error-page {
  text-align: center;
  padding: 60px 20px;
  color: #a0aec0;
}

.error-page .err-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

/* ===== 新建工单页（create- 命名空间，避免与通用类冲突） ===== */

.create-mode-tabs {
  display: flex;
  background: #fff;
  border-radius: 10px;
  padding: 4px;
  margin: 0 0 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.create-mode-tab {
  flex: 1;
  text-align: center;
  padding: 10px 4px;
  font-size: 14px;
  color: #718096;
  border-radius: 8px;
  transition: all 0.2s;
  cursor: pointer;
}

.create-mode-tab--active {
  background: #2b6cb0;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(43,108,176,0.25);
}

.create-field {
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.create-field__label {
  display: block;
  font-size: 13px;
  color: #718096;
  margin-bottom: 8px;
  font-weight: 500;
}

.create-field__label .req {
  color: #e53e3e;
  margin-left: 2px;
}

.create-field__label .hint {
  color: #a0aec0;
  font-weight: 400;
  font-size: 12px;
  margin-left: 6px;
}

.create-field__select,
.create-field__input,
.create-field__textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  color: #2d3748;
  background: #fff;
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.create-field__select {
  padding-right: 36px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a0aec0' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 12px;
}

.create-field__select:focus,
.create-field__input:focus,
.create-field__textarea:focus {
  outline: none;
  border-color: #2b6cb0;
}

.create-field__select:disabled,
.create-field__input--readonly {
  background: #f7fafc;
  color: #a0aec0;
  cursor: not-allowed;
}

.create-field__input--readonly:not([disabled]):read-only {
  background: #f7fafc;
  color: #4a5568;
}

.create-field__textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.create-summary {
  background: #fff5f5;
  border: 1px solid #fed7d7;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 16px 0 10px;
}

.create-summary__title {
  font-size: 12px;
  color: #c53030;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.create-summary__main {
  font-size: 15px;
  color: #2d3748;
  font-weight: 600;
  line-height: 1.5;
  word-break: break-all;
  margin-bottom: 8px;
}

.create-summary__sep {
  color: #cbd5e0;
  margin: 0 4px;
  font-weight: 400;
}

.create-summary__fault {
  font-size: 14px;
  color: #744210;
  line-height: 1.6;
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  white-space: pre-wrap;
  word-break: break-all;
}

.create-summary__fault--empty {
  color: #cbd5e0;
  background: transparent;
  padding: 0;
  font-size: 13px;
}

.create-error {
  background: #fff5f5;
  color: #c53030;
  border: 1px solid #feb2b2;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  margin: 8px 0;
}

.create-submit {
  width: 100%;
  background: #2b6cb0;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 17px;
  font-weight: 700;
  margin-top: 8px;
  margin-bottom: 20px;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  box-shadow: 0 2px 6px rgba(43,108,176,0.3);
}

.create-submit:active:not(:disabled) {
  background: #2c5282;
}

.create-submit:disabled,
.create-submit--loading {
  background: #a0aec0;
  cursor: not-allowed;
  opacity: 0.85;
  box-shadow: none;
}

/* 列表页新建工单按钮（固定在 tab 上方，sticky 跟随） */
.list-create-btn {
  background: #2b6cb0;
  color: #fff;
  text-align: center;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  display: block;
  box-shadow: 0 1px 3px rgba(43,108,176,0.2);
  letter-spacing: 0.5px;
}

/* ========= 阶段1-5：工单处理操作区（op- 命名空间，避免与现有样式冲突） ========= */

/* 身份选择条：位于页面 header 和详情卡片之间，sticky 顶部 */
.op-user-bar {
  position: sticky;
  top: 48px;
  z-index: 5;
  background: #fff4df;
  border-bottom: 1px solid #f4d48a;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #6b4600;
  flex-wrap: wrap;
}
.op-user-bar > label { font-weight: 600; white-space: nowrap; }
.op-user-bar select {
  flex: 1;
  min-width: 180px;
  padding: 8px 10px;
  border: 1px solid #f1c35a;
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
  color: #222;
}
.op-user-eng {
  font-size: 12px;
  color: #8a5a00;
  background: #ffe5a8;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

/* 操作警告 banner（未选身份） */
.op-warn {
  margin: 12px 16px;
  padding: 12px 14px;
  background: #fff4e5;
  border: 1px solid #ffbf75;
  border-radius: 10px;
  color: #8a4b00;
  font-size: 14px;
  line-height: 1.5;
}
.op-warn__icon { margin-right: 6px; font-weight: 700; }

/* 错误提示 banner */
.op-error {
  margin: 12px 16px 0;
  padding: 10px 14px;
  background: #fde8e8;
  border: 1px solid #f5a1a1;
  border-radius: 10px;
  color: #9b1c1c;
  font-size: 14px;
}

/* 操作卡（底部主区） */
#action-area {
  padding: 0 0 100px;
}
.op-card {
  margin: 14px 16px 0;
  background: #fff;
  border-radius: 14px;
  padding: 16px 18px 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 4px 14px rgba(0,0,0,0.04);
  border-left: 4px solid transparent;
}
.op-card--primary  { border-left-color: #2b6cb0; }
.op-card--locked   { border-left-color: #cbd5e0; background: #f7fafc; }
.op-card--done     { border-left-color: #38a169; background: #f0fff4; }

.op-card__title {
  font-size: 17px;
  font-weight: 700;
  color: #1a365d;
  margin-bottom: 6px;
}
.op-card__desc {
  font-size: 13.5px;
  line-height: 1.6;
  color: #4a5568;
  margin-bottom: 14px;
  white-space: pre-line;
}

/* 表单字段 */
.op-field { margin: 10px 0 14px; }
.op-field > label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 6px;
}
.op-req { color: #e53e3e; margin-left: 2px; }
.op-field select,
.op-field input[type="number"],
.op-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e0;
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
  color: #1a202c;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.op-field select:focus,
.op-field input:focus,
.op-field textarea:focus {
  outline: none;
  border-color: #2b6cb0;
  box-shadow: 0 0 0 3px rgba(43,108,176,0.15);
}
.op-field textarea { resize: vertical; min-height: 70px; line-height: 1.6; }

/* 填写提示 */
.op-tip {
  font-size: 12.5px;
  line-height: 1.7;
  color: #718096;
  background: #f7fafc;
  padding: 10px 12px;
  border-radius: 8px;
  margin: 8px 0 14px;
}

/* 操作按钮（大点击区域，手机优先） */
.op-btn {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: none;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s, transform .05s;
  letter-spacing: 0.5px;
}
.op-btn:active { transform: scale(0.99); }
.op-btn--primary {
  background: linear-gradient(180deg, #2f80d1 0%, #2b6cb0 100%);
  color: #fff;
  box-shadow: 0 3px 8px rgba(43,108,176,0.3);
}
.op-btn--primary:disabled {
  background: #b8c6d6 !important;
  box-shadow: none !important;
  cursor: not-allowed;
  color: #f7fafc !important;
}
.op-btn--loading { opacity: 0.85; pointer-events: none; }

/* ========= 阶段1-6：待结算列表卡片 + 结算状态标签 ========= */

/* 待结算卡片左侧高亮边框 */
.ticket-card.card-settling {
  border-left: 3px solid #d69e2e;
}

/* 应收金额高亮 */
.card-fee-row .fee-highlight {
  color: #c53030;
  font-weight: 700;
  font-size: 15px;
}

/* 结算状态标签 */
.settle-tag {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.settle-tag.settle-pending { background: #feebc8; color: #c05621; }
.settle-tag.settle-done { background: #c6f6d5; color: #2f855a; }

/* ========= 阶段1-6：详情页结算操作卡片 ========= */
.op-card--settle {
  border-left-color: #d69e2e;
}
.settle-receivable {
  color: #c53030;
  font-weight: 700;
  font-size: 18px;
}
