.xiang-page {
  padding-bottom: 40px;
}

.xiang-form {
  width: 100%;
  max-width: none;
}

.xiang-form-row {
  margin-bottom: 20px;
}

.xiang-form-hint,
.xiang-book-label,
.xiang-card-desc,
.xiang-mobile-tip,
.xiang-qr-status,
.xiang-preview-label,
.xiang-mobile-message,
.xiang-file-name,
.xiang-mobile-success-title,
.xiang-mobile-success-text,
.xiang-step {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #666;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.xiang-book-label {
  font-size: 15px;
  color: #333;
}

.xiang-desktop-only {
  display: block;
}

.xiang-mobile-only {
  display: none;
}

.xiang-photo-layout {
  width: 100%;
  margin-top: 12px;
}

.xiang-photo-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.xiang-upload-card {
  display: flex;
  flex-direction: column;
  padding: 18px;
  background: #fffdf8;
  border: 1px solid rgba(121, 85, 72, 0.16);
  border-radius: 8px;
  min-width: 0;
}

.xiang-card-title {
  margin: 0 0 8px;
  font-family: "SiYuanSongTi", serif;
  font-size: 17px;
  color: #4e342e;
}

.xiang-card-desc {
  margin-bottom: 14px;
}

.xiang-dropzone {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 160px;
  padding: 16px;
  border: 2px dashed rgba(121, 85, 72, 0.28);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.xiang-dropzone:hover,
.xiang-dropzone.is-dragover {
  border-color: #8d6e63;
  background: #faf6ef;
}

.xiang-dropzone-text {
  font-size: 14px;
  line-height: 1.5;
  color: #5d4037;
  text-align: center;
}

.xiang-dropzone-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(109, 76, 65, 0.08);
  color: #6d4c41;
  font-size: 28px;
  line-height: 1;
}

.xiang-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.xiang-qr-card .xiang-qr-wrap {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 160px;
}

.xiang-qr-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 240px;
  aspect-ratio: 1;
  padding: 12px;
  border: 2px dashed rgba(121, 85, 72, 0.2);
  border-radius: 8px;
  background: #fff;
  position: relative;
}

.xiang-qr-box.is-expired .xiang-qr-img {
  display: none;
}

.xiang-qr-expired {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  text-align: center;
}

.xiang-qr-expired[hidden] {
  display: none !important;
}

.xiang-qr-box.is-expired .xiang-qr-expired {
  display: flex;
}

.xiang-qr-expired-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: #8d6e63;
}

.xiang-qr-refresh {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(121, 85, 72, 0.28);
  border-radius: 6px;
  background: #fff;
  color: #6d4c41;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
}

.xiang-qr-status.is-expired {
  color: #c62828;
}

.xiang-qr-img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 220px;
  max-height: 220px;
  object-fit: contain;
  border-radius: 4px;
}

.xiang-qr-status {
  text-align: center;
}

.xiang-qr-status.is-ready {
  color: #2e7d32;
}

.xiang-login-tip {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #fff3e0;
  border: 1px solid rgba(230, 81, 0, 0.25);
  color: #6d4c41;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.xiang-inline-login {
  display: inline;
  margin: 0;
  padding: 0 2px;
  min-height: 32px;
  border: none;
  background: none;
  color: #bf360c;
  font-size: inherit;
  line-height: inherit;
  text-decoration: underline;
  cursor: pointer;
  white-space: nowrap;
}

.xiang-mobile-panel {
  padding: 16px;
  background: #fffdf8;
  border: 1px solid rgba(121, 85, 72, 0.16);
  border-radius: 8px;
}

.xiang-mobile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.xiang-mobile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 132px;
  padding: 0 18px;
  border: 1px solid rgba(121, 85, 72, 0.28);
  border-radius: 8px;
  background: #fff;
  color: #4e342e;
  font-size: 15px;
  line-height: 1.4;
  cursor: pointer;
  user-select: none;
}

.xiang-mobile-btn.primary {
  background: #6d4c41;
  border-color: #6d4c41;
  color: #fff;
}

.xiang-mobile-tip {
  margin-top: 12px;
}

.xiang-mobile-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 16px;
}

.xiang-step {
  padding: 4px 10px;
  border-radius: 999px;
  background: #f3ece3;
  color: #8d6e63;
  font-size: 13px;
}

.xiang-step.is-active {
  background: #6d4c41;
  color: #fff;
}

.xiang-step.is-done {
  background: #e8f5e9;
  color: #2e7d32;
}

.xiang-preview-wrap {
  display: flex;
  flex-direction: column;
  padding: 18px;
  background: #fffdf8;
  border: 1px solid rgba(121, 85, 72, 0.16);
  border-radius: 8px;
  min-width: 0;
}

.xiang-preview-wrap .xiang-card-title {
  margin-bottom: 12px;
}

.xiang-preview-stage {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 12px;
  border: 2px dashed rgba(121, 85, 72, 0.2);
  border-radius: 8px;
  background: #faf6ef;
}

.xiang-preview-empty {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #8d6e63;
  text-align: center;
}

.xiang-preview-wrap.has-photo .xiang-preview-empty {
  display: none;
}

.xiang-preview-img {
  display: none;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: 6px;
  object-fit: contain;
  background: #fff;
}

.xiang-preview-wrap.has-photo .xiang-preview-img {
  display: block;
}

.xiang-preview-wrap.has-photo .xiang-preview-stage {
  background: #fff;
  border-style: solid;
  border-color: rgba(121, 85, 72, 0.12);
}

.xiang-file-name {
  margin-top: 8px;
  text-align: center;
  color: #8d6e63;
}

.xiang-preview-clear {
  display: block;
  margin: 10px auto 0;
  padding: 0;
  border: 0;
  background: none;
  color: #6d4c41;
  font-size: 14px;
  line-height: 1.5;
  text-decoration: underline;
  cursor: pointer;
  min-height: 32px;
}

#xiang-submit:disabled,
#xiang-m-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.xiang-analyze-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.45);
}

.xiang-analyze-loading[hidden] {
  display: none !important;
}

.xiang-analyze-loading-inner {
  width: min(100%, 360px);
  padding: 20px 18px;
  border-radius: 10px;
  background: #fffdf8;
  border: 1px solid rgba(121, 85, 72, 0.18);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.xiang-analyze-loading-text {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.6;
  color: #4e342e;
  text-align: center;
}

.xiang-analyze-loading-tip {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: #8d6e63;
  text-align: center;
}

.xiang-analyze-progress {
  height: 8px;
  border-radius: 999px;
  background: #f3ece3;
  overflow: hidden;
}

.xiang-analyze-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8d6e63, #6d4c41);
  transition: width 0.45s ease;
}

body.xiang-analyze-busy {
  overflow: hidden;
}

.xiang-result {
  margin-top: 20px;
  padding: 20px 24px;
  background: #fff;
  border: 1px solid rgba(121, 85, 72, 0.18);
  border-radius: 8px;
}

.xiang-result[hidden] {
  display: none !important;
}

.xiang-report-section {
  margin-bottom: 20px;
}

.xiang-report-section h3 {
  margin: 0 0 8px;
  font-family: "MicrosoftYaHei", "Microsoft YaHei", sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #4e342e;
}

.xiang-report-section p {
  margin: 0 0 8px;
  line-height: 1.65;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.xiang-feature-box {
  margin-bottom: 16px;
  padding: 12px 14px;
  background: #faf6ef;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.6;
}

.xiang-landmark-panel {
  margin-bottom: 20px;
  padding: 14px;
  background: #fff;
  border: 1px solid rgba(121, 85, 72, 0.14);
  border-radius: 8px;
}

.xiang-landmark-label {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.5;
  color: #5d4037;
}

.xiang-landmark-meta {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: #8d6e63;
  text-align: center;
}

.xiang-landmark-viz {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
  background: #111;
}

.xiang-landmark-viz canvas {
  display: block;
  width: 100%;
  height: auto;
}

.xiang-disclaimer-box {
  margin-top: 16px;
  padding: 12px;
  background: #fff8e1;
  border-radius: 6px;
  font-size: 13px;
  color: #6d4c41;
}

.xiang-mobile-page .ming-hero {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.xiang-mobile-upload-form .xiang-mobile-panel {
  margin-bottom: 0;
}

.xiang-mobile-upload-form #xiang-m-submit {
  margin-top: 16px;
}

.xiang-mobile-upload-form .xiang-preview-wrap:not([hidden]) {
  margin-top: 12px;
}

.xiang-mobile-upload-form .xiang-preview-wrap.has-photo .xiang-preview-img {
  display: block;
  max-width: 100%;
  height: auto;
  margin-top: 12px;
  border-radius: 6px;
  object-fit: contain;
  background: #fff;
}

.xiang-mobile-upload-form .xiang-preview-label {
  font-size: 15px;
  color: #4e342e;
}

.xiang-mobile-message {
  margin-top: 12px;
  text-align: center;
}

.xiang-mobile-message.is-success {
  color: #2e7d32;
}

.xiang-mobile-message.is-error {
  color: #c62828;
}

.xiang-mobile-success {
  margin-top: 16px;
  padding: 16px;
  text-align: center;
  background: #e8f5e9;
  border: 1px solid rgba(46, 125, 50, 0.2);
  border-radius: 8px;
}

.xiang-mobile-success[hidden] {
  display: none !important;
}

.xiang-mobile-success-title {
  margin-bottom: 6px;
  font-size: 16px;
  font-weight: 700;
  color: #2e7d32;
}

.xiang-mobile-success-text {
  color: #33691e;
}

@media (min-width: 801px) {
  .xiang-mobile-only {
    display: none !important;
  }

  .xiang-photo-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
  }

  .xiang-photo-left {
    grid-column: 1;
  }

  .xiang-preview-wrap {
    grid-column: 2;
    min-height: 100%;
  }

  .xiang-preview-stage {
    min-height: 360px;
  }

  .xiang-preview-wrap.has-photo .xiang-preview-img {
    max-height: 420px;
  }
}

@media (max-width: 800px) {
  .xiang-desktop-only {
    display: none !important;
  }

  .xiang-mobile-only {
    display: block;
  }

  .xiang-photo-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .xiang-preview-wrap:not(.has-photo) {
    display: none;
  }

  .xiang-result {
    padding: 16px;
  }

  .xiang-mobile-btn {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
  }

  #xiang-submit,
  #xiang-m-submit {
    width: 100%;
    min-height: 44px;
  }
}
