/* ========================================
   NFC Share Page - 移动端样式
   ======================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --wechat: #07c160;
  --douyin: #111;
  --xhs: #fe2c55;

  --bg: #f5f5f7;
  --card-bg: #fff;
  --text: #1f2937;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --radius: 16px;
  --radius-sm: 10px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: 40px;
}

/* --- Header --- */
.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 28px 20px 32px;
  text-align: center;
  border-radius: 0 0 24px 24px;
}

.brand-tag {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 13px;
  margin-bottom: 12px;
}

.brand-name {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.brand-subtitle {
  font-size: 14px;
  opacity: 0.85;
}

/* --- Sections --- */
section {
  margin: 16px 12px;
}

.section-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  padding-left: 4px;
  letter-spacing: 0.5px;
}

/* --- Gallery --- */
.gallery-section {
  margin-top: -12px;
  position: relative;
  z-index: 2;
}

.gallery-wrapper {
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--card-bg);
}

.gallery-track {
  display: flex;
  transition: transform 0.3s ease;
  will-change: transform;
}

.gallery-track img {
  width: 100%;
  flex-shrink: 0;
  aspect-ratio: 16/10;
  object-fit: cover;
  display: block;
  /* 图片加载完成后淡入 */
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Loading skeleton */
.gallery-loading {
  aspect-ratio: 16/10;
  position: relative;
  overflow: hidden;
  background: #e5e7eb;
}

.gallery-loading .shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.6) 50%, transparent 100%);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.gallery-track.loaded + .gallery-loading,
.gallery-loading.hidden {
  display: none;
}

.gallery-track .gallery-placeholder {
  width: 100%;
  flex-shrink: 0;
  aspect-ratio: 16/10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e0e7ff 0%, #f3e8ff 100%);
  color: #a5b4fc;
  font-size: 14px;
}

.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.gallery-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d1d5db;
  transition: all 0.3s;
}

.gallery-dot.active {
  background: var(--primary);
  width: 24px;
  border-radius: 4px;
}

.gallery-hint {
  text-align: center;
  margin-top: 6px;
  font-size: 12px;
  color: #9ca3af;
}

/* --- Text Card --- */
.text-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.share-text {
  font-family: inherit;
  font-size: 15px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 24px;
  border: none;
  border-radius: 25px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  width: 100%;
  padding: 14px;
  font-size: 16px;
}

.btn-outline {
  background: var(--card-bg);
  color: var(--primary);
  border: 2px solid var(--primary);
  width: 100%;
  justify-content: center;
}

.btn-outline:active {
  background: #eef2ff;
}

.btn-block {
  width: 100%;
}

/* --- Action Cards --- */
.action-card {
  display: flex;
  align-items: center;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.2s;
  border-left: 4px solid transparent;
}

.action-card:active {
  transform: scale(0.98);
  background: #f9fafb;
}

.action-card-left {
  margin-right: 14px;
}

.action-icon {
  font-size: 28px;
  display: block;
  width: 44px;
  height: 44px;
  line-height: 44px;
  text-align: center;
  border-radius: 12px;
}

.save-card .action-icon { background: #fef3c7; }
.wechat-card { border-left-color: var(--wechat); }
.wechat-card .action-icon { background: #d1fae5; }
.douyin-card { border-left-color: var(--douyin); }
.douyin-card .action-icon { background: #f3f4f6; }
.xhs-card { border-left-color: var(--xhs); }
.xhs-card .action-icon { background: #ffe4e6; }

.action-card-center { flex: 1; }
.action-title { font-size: 16px; font-weight: 600; margin-bottom: 3px; }
.action-desc { font-size: 13px; color: var(--text-secondary); }
.action-card-right { font-size: 20px; color: #d1d5db; }

.btn-copy-text {
  margin-top: 0;
}

/* --- Usage Tags --- */
.usage-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.usage-tag {
  background: var(--card-bg);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* --- NFC Steps --- */
.nfc-steps {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 8px 16px;
  box-shadow: var(--shadow);
}

.nfc-step {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.nfc-step:last-child {
  border-bottom: none;
}

.nfc-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nfc-step-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.nfc-step-desc {
  font-size: 13px;
  color: var(--text-secondary);
}

/* --- Footer --- */
.footer {
  text-align: center;
  padding: 24px 0 8px;
  font-size: 12px;
  color: #d1d5db;
}

/* --- Modal --- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 100;
  align-items: flex-end;
  justify-content: center;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 24px 20px 32px;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.modal-icon { font-size: 32px; }
.modal-title { font-size: 20px; font-weight: 700; }

.modal-body {
  margin-bottom: 16px;
}

.modal-body .guide-step {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  align-items: flex-start;
}

.guide-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.guide-step-text {
  font-size: 15px;
  line-height: 1.6;
  padding-top: 1px;
}

.modal-close {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  background: #f3f4f6;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 600;
  border-radius: 25px;
  cursor: pointer;
  font-family: inherit;
  margin-top: 12px;
}

.modal-close:active {
  background: #e5e7eb;
}

/* --- Toast --- */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(31,41,55,0.92);
  color: #fff;
  padding: 14px 28px;
  border-radius: 25px;
  font-size: 15px;
  font-weight: 600;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  transition: all 0.25s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* --- Image Preview --- */
.preview-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 150;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.preview-overlay.show {
  display: flex;
}

.preview-close {
  position: absolute;
  top: 16px;
  right: 20px;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  z-index: 1;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-img {
  max-width: 95%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 8px;
}

.preview-tip {
  color: #9ca3af;
  font-size: 14px;
  margin-top: 20px;
  text-align: center;
}

/* --- Responsive --- */
@media (min-width: 481px) {
  .container {
    padding: 0 0 40px;
  }

  .header {
    border-radius: 0 0 24px 24px;
  }
}

@media (max-width: 360px) {
  .brand-name { font-size: 22px; }
  .action-title { font-size: 15px; }
}
