/* Upload page (drag-and-drop + QR mobile upload) and the shared crop/rotate
   modal, both extending the tokens and .waitlist-modal pattern in style.css. */

.tingxie-upload-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 40px 0;
}

.tingxie-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 32px;
  text-align: center;
}

/* --- Dropzone --- */
.tingxie-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  border: 2px dashed var(--border);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.tingxie-dropzone.is-dragover {
  border-color: var(--coral);
  background: #fff6f8;
}
.tingxie-dropzone-icon { width: 48px; height: 48px; }
.tingxie-dropzone-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  color: var(--ink-soft);
}
.tingxie-dropzone-label strong { color: var(--ink); font-size: 1.05rem; }
.tingxie-dropzone input[type="file"] {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* --- QR panel --- */
.tingxie-qr-panel h3 { margin-bottom: 6px; }
.tingxie-qr-panel p { color: var(--ink-soft); font-size: 0.92rem; }
.tingxie-qr-svg {
  width: 180px;
  margin: 12px auto;
  padding: 12px;
  background: #fff;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.tingxie-qr-svg svg { width: 100%; height: auto; display: block; }
.tingxie-qr-status {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin: 0;
}

/* --- Tips --- */
.tingxie-tips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
.tingxie-tips-col {
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  border: 1px solid var(--border);
}
.tingxie-tips-col h3 { margin-bottom: 12px; font-size: 1.05rem; }
.tingxie-tips-col ul { margin: 0; padding-left: 1.2em; color: var(--ink-soft); }
.tingxie-tips-col li { margin-bottom: 8px; }
.tingxie-tips-do { border-left: 4px solid var(--grass); }
.tingxie-tips-dont { border-left: 4px solid var(--coral); }

/* --- Crop/rotate modal --- */
.tingxie-crop-modal {
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 560px;
  width: calc(100% - 40px);
  box-shadow: var(--shadow-lg);
}
.tingxie-crop-modal::backdrop { background: rgba(45, 42, 38, 0.55); }
.tingxie-crop-modal-body { position: relative; padding: 32px 28px 28px; text-align: center; }
.tingxie-editor-hint { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 16px; }

.tingxie-editor-canvas-wrap {
  position: relative;
  margin: 0 auto 20px;
  touch-action: none;
  line-height: 0;
}
#tingxie-editor-canvas { max-width: 100%; border-radius: var(--radius-sm); }

.tingxie-crop-box {
  position: absolute;
  border: 2px solid var(--coral);
  box-shadow: 0 0 0 2000px rgba(45, 42, 38, 0.45);
  touch-action: none;
  cursor: move;
}
.tingxie-crop-handle {
  position: absolute;
  width: 18px; height: 18px;
  margin: -9px;
  background: var(--coral);
  border: 2px solid #fff;
  border-radius: 50%;
  touch-action: none;
}
.tingxie-crop-handle[data-handle="nw"] { top: 0; left: 0; cursor: nwse-resize; }
.tingxie-crop-handle[data-handle="ne"] { top: 0; left: 100%; cursor: nesw-resize; }
.tingxie-crop-handle[data-handle="sw"] { top: 100%; left: 0; cursor: nesw-resize; }
.tingxie-crop-handle[data-handle="se"] { top: 100%; left: 100%; cursor: nwse-resize; }

.tingxie-editor-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.tingxie-editor-actions[hidden] { display: none; }
.tingxie-editor-actions .btn { padding: 10px 20px; box-shadow: none; }

.tingxie-editor-progress { padding: 36px 12px 8px; }
.tingxie-progress-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 16px;
}
.tingxie-progress-fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 0%;
  background: var(--coral);
  border-radius: 999px;
  transition: width 0.2s ease;
}
.tingxie-progress-fill.is-indeterminate {
  width: 30%;
  animation: tingxie-progress-slide 1.2s ease-in-out infinite;
}
@keyframes tingxie-progress-slide {
  0% { left: -30%; }
  100% { left: 100%; }
}
.tingxie-progress-status { font-weight: 700; color: var(--ink-soft); margin: 0 0 4px; }
.tingxie-progress-status.is-error { color: var(--coral-dark); }
#tingxie-progress-retry { margin-top: 12px; padding: 10px 20px; box-shadow: none; }
#tingxie-progress-retry[hidden] { display: none; }

/* --- Mobile-facing upload page --- */
.tingxie-mobile-container { display: flex; justify-content: center; }
.tingxie-mobile-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 40px 28px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}
.tingxie-mobile-icon { font-size: 2.4rem; display: block; margin-bottom: 8px; }
.tingxie-mobile-card form { display: flex; flex-direction: column; gap: 16px; margin-top: 20px; }
.tingxie-mobile-card input[type="file"] {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  width: 100%;
}
.tingxie-mobile-errors {
  color: var(--coral-dark);
  font-size: 0.9rem;
  text-align: left;
  margin: 12px 0 0;
}

@media (max-width: 720px) {
  .tingxie-upload-panels,
  .tingxie-tips { grid-template-columns: 1fr; }
}
