* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --accent: #ff2442;
  --bg: #101014;
  --card: #1b1b21;
  --line: #2a2a33;
  --text: #f2f2f5;
  --muted: #9a9aa5;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  padding-top: calc(14px + env(safe-area-inset-top));
  position: sticky;
  top: 0;
  background: rgba(16, 16, 20, 0.92);
  backdrop-filter: blur(8px);
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo {
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  padding: 4px 7px;
  border-radius: 8px;
  letter-spacing: 1px;
}
.header h1 { font-size: 18px; font-weight: 700; }
.icon-btn {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  width: 38px;
  height: 38px;
  font-size: 18px;
}

.main {
  max-width: 520px;
  margin: 0 auto;
  padding: 8px 14px 40px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
}

.input-card textarea {
  width: 100%;
  min-height: 96px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  padding: 12px;
  font-size: 15px;
  resize: vertical;
}
.input-card textarea:focus { outline: 1px solid var(--accent); }

.row { display: flex; gap: 10px; margin-top: 12px; }
.row .btn { flex: 1; }

.btn {
  display: block;
  text-align: center;
  border: none;
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  background: #2b2b34;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.btn.block { display: block; width: 100%; margin-top: 10px; }
.btn:active { opacity: 0.85; }

.status {
  text-align: center;
  color: var(--muted);
  padding: 18px;
  font-size: 14px;
}

.tip {
  margin: 0 14px 10px;
  padding: 10px 12px;
  background: rgba(255, 36, 66, 0.12);
  border: 1px solid rgba(255, 36, 66, 0.35);
  color: #ffb3bd;
  border-radius: 12px;
  font-size: 13px;
}

.note-title {
  font-size: 15px;
  font-weight: 700;
  margin: 4px 2px 12px;
  word-break: break-all;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

/* 两列网格: 图片卡片 */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.grid-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
}
.grid-card .media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}
.grid-card .live-tag {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}
.grid-card .copy-link {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
}
.grid-card .actions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
}
.grid-card .actions .btn {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 9px 4px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
}
.grid-card .actions .btn:last-child { border-right: none; }
.grid-card .actions .btn:active { background: rgba(255, 255, 255, 0.15); }

.btn-col { margin-top: 4px; }

video {
  width: 100%;
  border-radius: 12px;
  background: #000;
  display: block;
}

.alt-streams { margin-top: 10px; }
.alt-streams summary {
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  padding: 6px 2px;
}

.help summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.help ul { margin: 10px 0 2px 18px; }
.help li { font-size: 13px; color: var(--muted); margin-bottom: 6px; }

.muted { color: var(--muted); font-size: 13px; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
}
.modal-card {
  background: var(--card);
  width: 100%;
  max-width: 520px;
  border-radius: 18px 18px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
}
.modal-card h2 { font-size: 17px; margin-bottom: 6px; }
.modal-card textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  padding: 10px;
  font-size: 13px;
  margin: 8px 0 2px;
  word-break: break-all;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(60px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: #33333d;
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  max-width: 86vw;
  z-index: 200;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.hidden { display: none !important; }

/* 微信内全屏媒体查看器: 点按钮直接打开, 长按保存 */
.viewer {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 150;
  display: flex;
  flex-direction: column;
}
.viewer-holder {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 46px 8px calc(52px + env(safe-area-inset-bottom));
}
.viewer-holder img,
.viewer-holder video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  border-radius: 0;
}
.viewer-close {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  right: 12px;
  color: #fff;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 7px 16px;
  z-index: 160;
}
.viewer-tip {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  text-align: center;
  color: #e8e8ee;
  font-size: 13px;
  padding: 12px 10px calc(14px + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.55);
}
