/**
 * 用户端样式 - Quasar UI 适配
 */

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: #f0f2f5;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* ============ 页面布局 ============ */

.tools-page { min-height: 100vh; padding: 0; }
.tools-card { background: #fff; border-radius: 12px; padding: 4px; margin: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.tools-tip { font-size: 16px; font-weight: 600; color: #333; text-align: center; margin-bottom: 12px; }

/* ============ 扫码区域 ============ */

.reader-wrap { position: relative; }
.reader {
  border-radius: 8px;
  overflow: hidden;
  background: #f0f2f5;
  aspect-ratio: 1 / 1;
}
.reader video { border-radius: 8px; }
.reader-placeholder {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.btn-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.btn-row .q-btn { flex: 1; min-width: 80px; }

.status { font-size: 13px; color: #757575; margin-top: 10px; text-align: center; }
.status.error { color: #e53935; }

/* ============ 测量结果 ============ */

.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.result-span2 { grid-column: 1 / -1; text-align: center; }
.result-item { background: #f7f8fa; border-radius: 8px; padding: 10px 12px; }
.result-label { font-size: 12px; color: #9e9e9e; margin-bottom: 4px; }
.result-value { font-size: 14px; color: #424242; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ============ 穿搭展示 ============ */

.outfit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.outfit-slot {
  background: #f7f8fa;
  border-radius: 8px;
  padding: 8px 4px;
  text-align: center;
  transition: transform 0.15s ease;
}
.outfit-slot:hover { transform: translateY(-2px); }
.outfit-slotname { font-size: 11px; color: #9e9e9e; margin-bottom: 6px; }
.outfit-icon {
  position: relative;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2d2d2d;
  border-radius: 8px;
  overflow: hidden;
}
.outfit-icon img { max-width: 100%; max-height: 56px; border-radius: 8px; filter: brightness(1.2); }
.outfit-name {
  font-size: 10px;
  color: #616161;
  margin-top: 4px;
  word-break: break-all;
  line-height: 1.4;
  max-height: 28px;
  overflow: hidden;
}
.outfit-name-en {
  font-size: 9px;
  color: #bdbdbd;
  word-break: break-all;
  line-height: 1.3;
  max-height: 24px;
  overflow: hidden;
}
.outfit-dye {
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3);
}

/* ============ 历史记录 ============ */

.rec-detail { padding: 0 4px; }
.rec-row {
  display: flex;
  align-items: center;
  padding: 10px 4px;
  border-bottom: 1px solid #f0f0f0;
}
.rec-time { flex: 1; font-size: 12px; color: #9e9e9e; }
.rec-pair {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-left: 12px;
  min-width: 52px;
}
.rec-pair i { font-style: normal; font-size: 10px; color: #bdbdbd; line-height: 1; }
.rec-pair span { font-size: 15px; font-weight: 600; color: #424242; font-variant-numeric: tabular-nums; line-height: 1.3; }
.rec-diff { font-size: 12px; font-weight: 600; margin-left: 8px; font-variant-numeric: tabular-nums; }
.diff-plus { color: #4caf50; }
.diff-minus { color: #2196f3; }

/* ============ 响应式 ============ */

@media (max-width: 600px) {
  .tools-card { margin: 8px; padding: 2px; }
  .result-grid { gap: 6px; }
  .outfit-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
}

/* ============ 裁剪区域 ============ */

.crop-container { position: relative; width: 100%; overflow: hidden; border-radius: 8px; background: #1a1a1a; }
.crop-canvas { width: 100%; display: block; touch-action: none; cursor: crosshair; }
