/* /yanji/assets/css/style.css */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  background: #f5f5f7;
  color: #1d1d1f;
  -webkit-font-smoothing: antialiased;
}

a {
  color: #007aff;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.page-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-container {
  flex: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 12px 40px;
}

/* 通用卡片 */
.card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
  padding: 14px 14px 16px;
  margin-bottom: 12px;
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
}

/* 输入框 */
.input-rounded {
  width: 100%;
  padding: 9px 11px;
  border-radius: 999px;
  border: 1px solid #d2d2d7;
  font-size: 14px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  background: #fff;
  margin-bottom: 10px;
}
.input-rounded:focus {
  border-color: #007aff;
  box-shadow: 0 0 0 1px rgba(0,122,255,.25);
}

/* 按钮 */
.btn-primary {
  width: 100%;
  padding: 10px 0;
  border-radius: 999px;
  border: none;
  background: #007aff;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease, transform .05s ease;
}
.btn-primary:hover {
  background: #0a84ff;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}
.btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.18);
}

/* 悬浮按钮 */
.floating-actions {
  position: fixed;
  right: 14px;
  bottom: 24px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.float-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #007aff;
  color: #fff;
  font-size: 12px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(0,0,0,0.3);
}
.float-btn.secondary {
  background: #34c759;
}

/* FAQ、结果页等复用样式 */
.faq-list {
  margin-top: 6px;
}
.faq-item {
  border-bottom: 1px solid #e5e5ea;
}
.faq-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 2px;
  cursor: pointer;
}
.faq-question {
  font-size: 14px;
  color: #111827;
}
.faq-icon {
  font-size: 18px;
  color: #9ca3af;
}
.faq-body {
  display: none;
  font-size: 13px;
  color: #4b5563;
  padding: 0 2px 8px;
}

/* 结果页用到的 chip、字段等 */
.device-header {
  display: flex;
  gap: 10px;
}
.device-header > div:first-child {
  flex: 1;
}
.device-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}
.device-desc {
  font-size: 13px;
  color: #4b5563;
  margin-bottom: 6px;
}
.device-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}
.device-ids {
  font-size: 12px;
  color: #4b5563;
  line-height: 1.5;
}
.device-photo img {
  max-width: 120px;
  border-radius: 12px;
}

/* chip */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f3f4f6;
  font-size: 12px;
  color: #111827;
}
.chip-label {
  font-size: 11px;
  color: #6b7280;
  margin-right: 3px;
}
.chip-good {
  background: #ecfdf3;
  color: #166534;
}
.chip-bad {
  background: #fef2f2;
  color: #b91c1c;
}
.chip-warn {
  background: #fffbeb;
  color: #92400e;
}
.chip-neutral {
  background: #f3f4f6;
  color: #111827;
}
.highlight-row {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* 结果分组卡片 */
.section-list {
  margin-top: 10px;
}
.section-card {
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 8px 10px 8px;
  margin-bottom: 6px;
  background: #f9fafb;
}
.section-title-small {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #111827;
}
.field-row {
  display: flex;
  font-size: 12px;
  padding: 2px 0;
}
.field-label {
  width: 100px;
  flex-shrink: 0;
  color: #6b7280;
}
.field-value {
  flex: 1;
  color: #111827;
}

/* loading / 错误 */
.status-loading {
  text-align: center;
  padding: 20px 0;
  font-size: 14px;
  color: #4b5563;
}
.spinner {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px solid #e5e7eb;
  border-top-color: #007aff;
  margin: 0 auto 8px;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.error-text {
  font-size: 13px;
  color: #b91c1c;
}

/* 历史查询用小表格 */
.table-small {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table-small th,
.table-small td {
  border-bottom: 1px solid #e5e7eb;
  padding: 4px 6px;
  text-align: left;
}
.table-small th {
  background: #f3f4f6;
}
.pre {
  white-space: pre-wrap;
  font-family: ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  color: #111827;
}
