/* 公众端移动优先样式 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #1a1a2e;
  background: linear-gradient(160deg, #f0f4ff 0%, #f8f9fc 40%, #eef2f7 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

body.no-scroll {
  overflow: hidden;
}

a {
  color: #1677ff;
  text-decoration: none;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 16px 16px 32px;
}

.page-header {
  text-align: center;
  padding: 24px 0 16px;
}

.page-header h1 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
}

.page-header p {
  margin: 0;
  color: #666;
  font-size: 14px;
}

.card {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 14px;
  padding: 20px 16px;
  box-shadow: 0 2px 12px rgba(100, 120, 200, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.8);
  margin-bottom: 16px;
}

.card-title {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 600;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 15px;
}

.info-row:last-child {
  border-bottom: none;
}

.info-row span:first-child {
  color: #666;
}

.countdown-display {
  text-align: center;
  padding: 24px 0;
}

.countdown-display .timer {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #1677ff;
  font-variant-numeric: tabular-nums;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: #333;
  font-weight: 500;
}

.form-group input,
.form-group select {
  width: 100%;
  height: 48px;
  padding: 0 12px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  font-size: 16px;
  background: #fff;
  appearance: none;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #1677ff;
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.15);
}

.field-error {
  margin-top: 6px;
  font-size: 13px;
  color: #ff4d4f;
}

.field-error[hidden] {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--primary {
  width: 100%;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.btn--primary:active:not(:disabled) {
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.btn--ghost {
  background: #f5f5f5;
  color: #333;
}

.btn--block {
  width: 100%;
}

.link-row {
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
}

.status-text {
  text-align: center;
  color: #666;
  font-size: 14px;
  margin: 8px 0;
}

.status-text[hidden],
.page-error[hidden] {
  display: none;
}

.page-error {
  background: #fff2f0;
  border: 1px solid #ffccc7;
  color: #cf1322;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 12px;
}

.success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #f6ffed;
  color: #52c41a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.success-number {
  text-align: center;
  font-size: 36px;
  font-weight: 700;
  color: #1677ff;
  margin: 8px 0;
}

.success-rank {
  text-align: center;
  font-size: 18px;
  color: #666;
}

.photo-upload {
  border: 2px dashed #d9d9d9;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.photo-upload input[type="file"] {
  width: 100%;
  height: auto;
  padding: 8px 0;
}

.photo-preview {
  margin-top: 12px;
  text-align: center;
}

.photo-preview__img {
  max-width: 120px;
  border-radius: 4px;
  border: 1px solid #eee;
}

.photo-preview__meta {
  font-size: 12px;
  color: #888;
  margin-top: 6px;
}

/* 裁剪 overlay */
.crop-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.crop-overlay__panel {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}

.crop-overlay__title {
  margin: 0;
  padding: 12px 16px 4px;
  font-size: 16px;
  text-align: center;
}

.crop-overlay__hint {
  margin: 0;
  padding: 0 16px 12px;
  font-size: 12px;
  color: #888;
  text-align: center;
  border-bottom: 1px solid #f0f0f0;
}

.crop-overlay__stage {
  height: 60vh;
  max-height: 420px;
  background: #000;
}

.crop-overlay__stage img {
  max-width: 100%;
  display: block;
}

.crop-overlay__actions {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
}

.crop-overlay__actions .btn {
  flex: 1;
}

.desktop-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  text-align: center;
}

.desktop-page .icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.desktop-page h1 {
  font-size: 22px;
  margin: 0 0 12px;
}

.desktop-page p {
  color: #666;
  max-width: 360px;
}

.result-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
}

.result-card h3 {
  margin: 0 0 12px;
  font-size: 17px;
}

.result-card dl {
  margin: 0;
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 8px 12px;
  font-size: 15px;
}

.result-card dt {
  color: #666;
}

.result-card dd {
  margin: 0;
  font-weight: 500;
}

.result-empty {
  text-align: center;
  color: #999;
  padding: 24px;
}

.closed-icon {
  text-align: center;
  font-size: 48px;
  margin-bottom: 12px;
}

.closed-meta {
  border-top: 1px solid #eee;
  padding-top: 14px;
  font-size: 14px;
  color: #555;
}

.closed-meta-name {
  margin: 0 0 10px;
  font-weight: 600;
  font-size: 15px;
  color: #1a1a2e;
  text-align: center;
}

.closed-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0;
  line-height: 1.4;
}

.closed-meta-row .label {
  flex-shrink: 0;
  color: #888;
}

.loading-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  color: #666;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e8e8e8;
  border-top-color: #1677ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 兼容旧页面类名 */
.container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 16px 16px 32px;
}

.hidden {
  display: none !important;
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 12px;
  padding: 12px;
  background: #f5f5f5;
  color: #333;
  border-radius: 8px;
}

.submit-hint {
  margin: 12px 0 0;
  font-size: 13px;
  color: #fa8c16;
  line-height: 1.5;
}

.link-btn {
  display: block;
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
}

.required {
  color: #ff4d4f;
}

.error-text {
  margin-top: 6px;
  font-size: 13px;
  color: #ff4d4f;
}

.form-group textarea {
  width: 100%;
  min-height: 88px;
  padding: 12px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  font-size: 16px;
  resize: vertical;
  font-family: inherit;
}

.doc-upload {
  border: 2px dashed #d9d9d9;
  border-radius: 8px;
  padding: 12px;
}

.doc-preview {
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.doc-preview__meta {
  margin: 6px 0 0;
  font-size: 12px;
  color: #888;
}

.doc-preview img {
  max-width: 100%;
  max-height: 160px;
  border-radius: 4px;
}

.doc-preview .placeholder {
  color: #999;
  font-size: 14px;
}

.doc-upload-btn {
  display: block;
  text-align: center;
  padding: 8px;
  background: #f5f5f5;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

.captcha-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.captcha-row input {
  flex: 1;
  height: 48px;
  padding: 0 12px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  font-size: 16px;
}

.captcha-img {
  width: 120px;
  height: 40px;
  border-radius: 4px;
  border: 1px solid #d9d9d9;
  cursor: pointer;
}

.notice-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.notice-modal__panel {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 12px;
  padding: 20px 16px;
  max-height: 80vh;
  overflow-y: auto;
}

.notice-modal__panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
  text-align: center;
}

.notice-modal__body {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.6;
  color: #444;
  margin-bottom: 16px;
}

.success-num {
  text-align: center;
  font-size: 36px;
  font-weight: 700;
  color: #1677ff;
  margin: 8px 0 16px;
}
