/* ScanUp · 码上 — Public viewer (/v/<id>)
   极简：扫码直接看，没有落地页、没有 CTA、没有品牌 footer。 */
:root {
  --ink: #0c0a09;
  --ink-soft: #78716c;
  --ink-faint: #a8a29e;
  --border: #e7e5e4;
  --bg: #fafaf9;
  --surface: #ffffff;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  height: 100%;
  background: #000;
  font-family: "Inter", -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  font-size: 15px;
}

.viewer {
  min-height: 100vh;
  position: relative;
}

/* ---------- 图片/视频：全屏直出 ---------- */
.media-fullscreen {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 0;
}
.media-img {
  /* 不限高: 长图(规则海报类)按全宽直出自然滚动，限 100vh 会把长图压成一窄条、两边全黑 */
  max-width: 100vw;
  width: auto;
  height: auto;
  display: block;
}
.media-video {
  width: 100vw;
  max-height: 100vh;
  display: block;
  background: #000;
}
/* 长图保存原图悬浮条 */
.img-save-bar {
  position: fixed;
  left: 0; right: 0; bottom: 24px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; z-index: 30;
}
.img-save-btn {
  pointer-events: auto;
  background: rgba(12,10,9,.82);
  color: #fff; text-decoration: none;
  font-size: 14px; font-weight: 600;
  padding: 10px 22px; border-radius: 100px;
  border: 1px solid rgba(255,255,255,.25);
  backdrop-filter: blur(8px);
}
.img-save-hint {
  pointer-events: none;
  background: rgba(12,10,9,.6);
  color: rgba(255,255,255,.85);
  font-size: 11px; padding: 4px 12px; border-radius: 100px;
}

/* ---------- 文件：极简下载卡 ---------- */
.file-view {
  background: var(--bg);
  min-height: 100vh;
  padding: 32px 18px;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.file-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.06);
}
.file-icon {
  flex-shrink: 0;
  width: 64px; height: 64px;
  border-radius: 12px;
  background: #8B5CF6;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
}
.file-info { min-width: 0; flex: 1; }
.file-name {
  font-size: 16px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-bottom: 4px;
}
.file-size {
  font-size: 12px; color: var(--ink-soft);
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

.file-actions {
  display: flex; gap: 10px;
}
.file-btn {
  flex: 1;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
}
.file-btn.primary {
  background: #8B5CF6;
  border-color: #8B5CF6;
  color: #fff;
}
.file-btn:active { transform: translateY(1px); }

.file-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink);
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 60vh;
  overflow: auto;
}

/* ---------- 文本片段 ---------- */
.text-view {
  background: var(--bg);
  min-height: 100vh;
  padding: 24px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.text-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  width: 100%;
  max-width: 720px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.text-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.5px;
}
.text-body {
  margin: 0;
  background: #faf9f7;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 60vh;
  overflow: auto;
}
.text-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.text-actions .text-btn {
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.text-actions .text-btn.primary {
  background: #8B5CF6;
  border-color: #8B5CF6;
  color: #fff;
}
.text-actions .text-meta {
  margin-left: auto;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--ink-faint);
}

/* ---------- 网址链接 ---------- */
.link-view {
  background: var(--bg);
  min-height: 100vh;
  padding: 32px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.link-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 4px 12px rgba(0,0,0,.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}
.link-label {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--ink-faint);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 4px;
}
.link-host {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  word-break: break-all;
}
.link-url {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--ink-soft);
  background: #faf9f7;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  word-break: break-all;
  text-align: left;
  max-height: 90px;
  overflow: auto;
}
.link-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.link-btn {
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
}
.link-btn.primary {
  background: #8B5CF6;
  border-color: #8B5CF6;
  color: #fff;
}
.link-btn:active { transform: translateY(1px); }
.link-tip {
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 4px;
}

/* ---------- Bundle：简洁网格 ---------- */
.bundle-view {
  background: var(--bg);
  min-height: 100vh;
  padding: 32px 18px;
  max-width: 720px;
  margin: 0 auto;
}
.bundle-title {
  font-size: 22px; font-weight: 700; color: var(--ink);
  margin-bottom: 6px;
}
.bundle-sub {
  font-size: 13px; color: var(--ink-soft);
  margin-bottom: 22px;
}
.bundle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.bundle-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  display: block;
  transition: transform 0.15s;
}
.bundle-tile:active { transform: scale(0.97); }
.bundle-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: #f4f4f2;
}
.bundle-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-faint);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 700;
  font-size: 14px;
}
.bundle-name {
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 水印 ---------- */
.viewer-watermark {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.18);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 8px;
  transform: rotate(-30deg);
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
  font-family: "Inter", "PingFang SC", sans-serif;
}

/* ---------- 空状态 ---------- */
.viewer.empty {
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 14px;
}

/* ---------- 密码门 / 已过期 等老页面保留 ---------- */
.gate {
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.gate-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  width: 100%; max-width: 380px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.06);
}
.gate-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; color: var(--ink); }
.gate-desc { font-size: 13px; color: var(--ink-soft); margin-bottom: 16px; line-height: 1.6; }
.gate-input {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 15px; font-family: inherit;
  outline: none; box-sizing: border-box;
}
.gate-input:focus { border-color: #8B5CF6; }
.gate-err { color: #dc2626; font-size: 12px; margin-top: 8px; }
.gate-btn {
  width: 100%; margin-top: 14px;
  padding: 12px 0;
  background: #8B5CF6; color: #fff;
  border: none; border-radius: 10px;
  font-size: 15px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
