/* 导出长图 · 顶栏按钮与预览层
 *
 * 预览层本身带 [data-no-export]，导出时会被整块剔除，
 * 所以这里的样式只影响屏幕，不会出现在生成的图片里。
 */

.export-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 27px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  transition: border-color 0.16s ease, color 0.16s ease, opacity 0.16s ease;
}

.export-btn:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.export-btn:active {
  opacity: 0.7;
}

.export-btn[disabled] {
  opacity: 0.45;
}

.export-btn svg {
  display: block;
}

/* ---------------- 预览层 ---------------- */

body.export-open {
  overflow: hidden;
}

.export-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.export-layer[hidden] {
  display: none;
}

.export-scrim {
  position: absolute;
  inset: 0;
  background: var(--scrim);
}

.export-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 90vh;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.18);
  animation: export-rise 0.22s ease-out;
}

@keyframes export-rise {
  from {
    transform: translateY(14px);
    opacity: 0.7;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.export-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px 9px;
}

.export-kicker {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 1.4px;
  color: var(--ink-3);
}

.export-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1;
}

.export-close:active {
  opacity: 0.65;
}

.export-stage {
  flex: 1;
  min-height: 120px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px;
}

.export-preview {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: var(--paper);
}

.export-hint-inline {
  display: block;
  padding: 0 0 12px;
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--ink-3);
  text-align: center;
}

.export-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 200px;
  color: var(--ink-2);
  font-size: 12.5px;
  letter-spacing: 0.3px;
}

.export-spin {
  width: 22px;
  height: 22px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: export-spin 0.85s linear infinite;
}

@keyframes export-spin {
  to {
    transform: rotate(360deg);
  }
}

.export-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 200px;
  padding: 0 24px;
  text-align: center;
}

.export-error-title {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--ink);
}

.export-error-desc {
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-3);
}

.export-foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px calc(11px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

.export-hint {
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-3);
}

.export-save {
  flex: none;
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--forest);
  color: var(--forest-ink);
  font-size: 12.5px;
  letter-spacing: 0.6px;
}

.export-save[hidden] {
  display: none;
}

.export-save:active {
  opacity: 0.8;
}

@media (min-width: 640px) {
  .export-layer {
    align-items: center;
    padding: 28px;
  }

  .export-panel {
    max-width: 520px;
    max-height: 86vh;
    border: 1px solid var(--line);
    border-radius: 16px;
  }

  .export-foot {
    padding-bottom: 11px;
  }
}
