:root {
  --bg: #0d0f14;
  --bg-soft: #141822;
  --card: rgba(255, 255, 255, 0.045);
  --card-border: rgba(255, 255, 255, 0.09);
  --text: #eceff5;
  --text-dim: #98a0b3;
  --primary: #fe2c55;
  --primary-soft: rgba(254, 44, 85, 0.14);
  --accent: #25f4ee;
  --ok: #38d39f;
  --warn: #ffb547;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

/* hidden 属性必须优先于各组件自己的 display 规则，否则会留下透明遮罩挡住点击 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(1100px 520px at 12% -10%, rgba(254, 44, 85, 0.18), transparent 60%),
    radial-gradient(900px 460px at 92% 4%, rgba(37, 244, 238, 0.12), transparent 58%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px clamp(16px, 5vw, 56px) 8px;
}

.brand { display: flex; align-items: center; gap: 14px; }

.logo {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--primary), #ff6b81);
  font-weight: 800; letter-spacing: 0.5px;
  box-shadow: 0 10px 24px rgba(254, 44, 85, 0.35);
}

.brand-text h1 { margin: 0; font-size: 20px; letter-spacing: 0.2px; }
.brand-text p { margin: 2px 0 0; font-size: 13px; color: var(--text-dim); }

.badge {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  border: 1px solid rgba(254, 44, 85, 0.35);
  color: #ff8ea0;
}

.container {
  width: min(1080px, calc(100% - 32px));
  margin: 12px auto 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.field-label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 120px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.32);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  font-family: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

textarea:focus {
  outline: none;
  border-color: rgba(254, 44, 85, 0.6);
  box-shadow: 0 0 0 3px rgba(254, 44, 85, 0.16);
}

.input-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 11px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  transition: transform 0.12s ease, background 0.18s ease, opacity 0.18s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn.primary {
  background: linear-gradient(135deg, var(--primary), #ff5470);
  box-shadow: 0 10px 22px rgba(254, 44, 85, 0.28);
}

.btn.ghost { background: rgba(255, 255, 255, 0.05); border-color: var(--card-border); }

.btn.small { padding: 7px 13px; font-size: 13px; border-radius: 9px; }

.spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.hint { margin: 12px 0 0; font-size: 12px; color: var(--text-dim); }
.hint code {
  background: rgba(255, 255, 255, 0.07);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 12px;
}

.alert {
  padding: 14px 18px;
  border-radius: 13px;
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid rgba(254, 44, 85, 0.35);
  background: rgba(254, 44, 85, 0.12);
  color: #ffb3bf;
}

.alert.ok {
  border-color: rgba(56, 211, 159, 0.35);
  background: rgba(56, 211, 159, 0.12);
  color: #86e9c6;
}

.alert .alert-title { font-weight: 700; margin-bottom: 4px; }
.alert .alert-detail { font-size: 12px; color: var(--text-dim); margin-top: 6px; word-break: break-all; }

.result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.result-head h2 {
  margin: 0 0 10px;
  font-size: 17px;
  line-height: 1.5;
  font-weight: 600;
  max-width: 620px;
  word-break: break-word;
}

.meta { flex: 1 1 320px; min-width: 0; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--card-border);
  color: var(--text-dim);
}

.chip.accent { color: var(--accent); border-color: rgba(37, 244, 238, 0.3); background: rgba(37, 244, 238, 0.1); }
.chip.muted { color: #7f8798; }

.warn {
  margin-top: 16px;
  font-size: 13px;
  color: var(--warn);
  background: rgba(255, 181, 71, 0.1);
  border: 1px solid rgba(255, 181, 71, 0.3);
  border-radius: 11px;
  padding: 10px 14px;
}

.media-area { margin-top: 20px; }

/* 图集九宫格 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.tile {
  position: relative;
  border-radius: 13px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--card-border);
  aspect-ratio: 3 / 4;
}

.tile img {
  width: 100%; height: 100%;
  /* 用 contain 完整展示画面，避免截断作品里的文字与构图 */
  object-fit: contain;
  background: #0a0c11;
  display: block;
  cursor: zoom-in;
  transition: transform 0.25s ease;
}

.tile:hover img { transform: scale(1.04); }

.tile .tile-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78), transparent);
}

.tile .tile-index { font-size: 12px; color: #dfe4ee; }

/* 实况项的封面 / 实况两个按钮并排 */
.tile .tile-actions { display: flex; align-items: center; gap: 8px; }

/* 实况照片（动图）标记 */
.tile-live {
  position: absolute;
  z-index: 2;  /* 必须高于图片，否则被 <img> 盖住无法点击 */
  top: 8px; left: 8px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(37, 244, 238, 0.18);
  border: 1px solid rgba(37, 244, 238, 0.5);
  color: #8ffcf7;
  backdrop-filter: blur(4px);
}

.tile-play {
  position: absolute;
  z-index: 2;  /* 同上：图片是后续兄弟节点，需要显式抬高层级 */
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.18s ease, transform 0.18s ease;
}

.tile-play:hover {
  background: rgba(254, 44, 85, 0.85);
  transform: translate(-50%, -50%) scale(1.08);
}

.lb-video {
  max-width: min(560px, 100%);
  max-height: 78vh;
  border-radius: 12px;
  background: #000;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

/* 视频 */
.video-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  justify-items: center;
}

.video-box {
  width: min(420px, 100%);
  border-radius: 15px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--card-border);
}

.video-box video { width: 100%; display: block; max-height: 72vh; background: #000; }

.video-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(420px, 100%);
  flex-wrap: wrap;
}

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: #6f7787;
  padding: 4px 6px 0;
  flex-wrap: wrap;
}

.foot a { color: #8f97a8; }

/* 灯箱 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(6, 8, 12, 0.94);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
}

.lightbox img {
  max-width: min(1100px, 100%);
  max-height: 78vh;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.lb-close {
  position: absolute;
  top: 18px; right: 22px;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.lb-bar { display: flex; gap: 10px; }

/* 实况/动态照片的导入提示，随平台给出不同说明 */
.lb-hint {
  margin: 14px 0 0;
  max-width: min(560px, 90vw);
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
  color: #9aa4b8;
}

@media (max-width: 640px) {
  .card { padding: 18px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .result-actions { width: 100%; }
  .result-actions .btn { width: 100%; }
  .lb-bar { flex-wrap: wrap; justify-content: center; }
  .brand-text p { display: none; }
}
