/* 微课广场：仿抖音竖屏流 + 拍摄 / 编辑 */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body.wk-body {
  background: #000;
  color: #fff;
  font: 14px/1.6 "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, sans-serif;
  -webkit-text-size-adjust: 100%;
  overflow: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }
img { display: block; }

/* ========== 广场流 ========== */
.wk-app {
  position: relative;
  height: 100svh;
  max-width: 560px;
  margin: 0 auto;
  background: #000;
  overflow: hidden;
}
.wk-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 8px) 12px 8px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .55), transparent);
}
.wk-back, .wk-top-cam {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  color: #fff;
}
.wk-back svg, .wk-top-cam svg { width: 24px; height: 24px; }
.wk-tabs { display: flex; align-items: center; gap: 20px; font-size: 16px; }
.wk-tabs a { color: rgba(255, 255, 255, .6); padding: 4px 2px; }
.wk-tabs a.on { color: #fff; font-weight: 700; }
.wk-tabs a.on::after {
  content: ""; display: block; width: 18px; height: 2px; margin: 5px auto 0;
  background: #fff; border-radius: 2px;
}

.wk-feed {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.wk-feed::-webkit-scrollbar { display: none; }
.wk-item {
  position: relative;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #000;
  overflow: hidden;
}
.wk-stage { position: absolute; inset: 0; display: grid; place-items: center; }
.wk-media { width: 100%; height: 100%; object-fit: contain; background: #000; }
.wk-imgs {
  width: 100%; height: 100%;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.wk-imgs::-webkit-scrollbar { display: none; }
.wk-imgs img { min-width: 100%; height: 100%; object-fit: contain; scroll-snap-align: center; }
.wk-imgs-dot {
  position: absolute; right: 12px; top: calc(env(safe-area-inset-top) + 56px);
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, .5); color: rgba(255, 255, 255, .85);
}

.wk-side {
  position: absolute; right: 10px; bottom: 108px; z-index: 4;
  display: grid; gap: 18px; justify-items: center;
}
.wk-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  border: 1.5px solid rgba(255, 255, 255, .85);
  font-size: 16px; font-weight: 700;
}
.wk-act {
  display: grid; justify-items: center; gap: 3px;
  background: none; border: 0; padding: 0; color: #fff;
  font-size: 11px; cursor: pointer;
}
.wk-act svg { width: 30px; height: 30px; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .45)); }
.wk-act b { font-weight: 600; }
.wk-like.on svg { fill: #fe2c55; stroke: #fe2c55; }
.wk-like.on b { color: #fe2c55; }

.wk-meta {
  position: absolute; left: 14px; right: 78px; bottom: 88px; z-index: 4;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .55);
}
.wk-user { font-size: 14px; font-weight: 700; color: rgba(255, 255, 255, .95); }
.wk-meta h2 { margin: 6px 0 4px; font-size: 17px; line-height: 1.4; font-weight: 700; }
.wk-meta p {
  margin: 0; font-size: 13px; line-height: 1.55; color: rgba(255, 255, 255, .86);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.wk-meta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 7px; font-size: 12px; color: rgba(255, 255, 255, .72); }
.wk-topic { color: #67e8f9; }

.wk-bar { position: absolute; left: 0; right: 0; bottom: 56px; height: 2px; background: rgba(255, 255, 255, .14); z-index: 5; }
.wk-bar i { display: block; height: 100%; width: 0; background: rgba(255, 255, 255, .9); }

.wk-tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 9;
  height: calc(56px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex; align-items: center; justify-content: space-around;
  background: linear-gradient(to top, rgba(0, 0, 0, .9), rgba(0, 0, 0, 0));
  font-size: 12px;
}
.wk-tabbar a { color: rgba(255, 255, 255, .6); padding: 6px 10px; }
.wk-tabbar a.on { color: #fff; font-weight: 700; }
.wk-plus span {
  display: grid; place-items: center;
  width: 46px; height: 30px; border-radius: 8px;
  background: linear-gradient(90deg, #25f4ee, #fe2c55);
  color: #000; font-size: 22px; font-weight: 700; line-height: 1;
}

.wk-empty {
  height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  padding: 0 44px; text-align: center;
}
.wk-empty b { font-size: 19px; }
.wk-empty p { margin: 0; font-size: 13px; color: rgba(255, 255, 255, .55); }
.wk-empty-btn {
  margin-top: 8px; padding: 10px 26px; border-radius: 999px;
  background: #fe2c55; color: #fff; font-size: 14px; font-weight: 700;
}
.wk-end {
  height: 40svh; display: grid; place-items: center;
  color: rgba(255, 255, 255, .38); font-size: 12px;
  scroll-snap-align: start;
}

/* ========== 拍摄页 ========== */
.wk-cam { position: fixed; inset: 0; background: #000; overflow: hidden; }
.wk-cam-video { width: 100%; height: 100%; object-fit: cover; }
.wk-cam-video.mirror { transform: scaleX(-1); }
.wk-cam-mask {
  position: absolute; inset: 0; z-index: 3;
  display: grid; place-items: center; text-align: center;
  padding: 0 44px; font-size: 14px; color: rgba(255, 255, 255, .85);
  background: rgba(0, 0, 0, .42);
}
.wk-cam-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
}
.wk-cam-close { font-size: 30px; line-height: 1; color: #fff; padding: 0 6px; }
.wk-cam-timer {
  font-size: 13px; padding: 4px 12px; border-radius: 999px;
  background: rgba(0, 0, 0, .5);
}
.wk-cam-flip {
  border: 0; border-radius: 999px; padding: 7px 15px;
  background: rgba(255, 255, 255, .16); color: #fff; font-size: 13px;
}
.wk-cam-hint {
  position: absolute; left: 0; right: 0; bottom: 152px; z-index: 4;
  margin: 0; text-align: center; font-size: 12.5px;
  color: rgba(255, 255, 255, .72); padding: 0 34px;
}
.wk-cam-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; justify-items: center;
  padding: 0 0 calc(env(safe-area-inset-bottom) + 26px);
}
.wk-cam-album { justify-self: start; margin-left: 28px; display: grid; justify-items: center; gap: 4px; font-size: 11px; color: #fff; cursor: pointer; }
.wk-cam-album-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; font-size: 20px;
  background: rgba(255, 255, 255, .16);
}
.wk-shutter {
  width: 76px; height: 76px; border-radius: 50%; padding: 0;
  border: 3px solid rgba(255, 255, 255, .85); background: transparent;
  display: grid; place-items: center; cursor: pointer;
}
.wk-shutter span { display: block; width: 61px; height: 61px; border-radius: 50%; background: #fe2c55; transition: all .18s ease; }
.wk-shutter.rec span { width: 32px; height: 32px; border-radius: 9px; }
.wk-cam-slot { width: 44px; }

/* 预览 / 编辑层 */
.wk-layer { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; background: #000; }
.wk-layer > video { flex: 1; width: 100%; min-height: 0; object-fit: contain; background: #000; }
.wk-pv-imgs { flex: 1; min-height: 0; }
.wk-layer-actions { display: flex; gap: 14px; padding: 16px 20px calc(env(safe-area-inset-bottom) + 20px); }
.wk-ghost {
  flex: 1; height: 46px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .3); background: transparent;
  color: #fff; font-size: 15px;
}
.wk-primary {
  height: 46px; padding: 0 26px; border-radius: 999px; border: 0;
  background: #fe2c55; color: #fff; font-size: 15px; font-weight: 700;
}
.wk-layer-actions .wk-primary { flex: 1; }

.wk-editor { background: #121212; }
.wk-editor-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 8px) 14px 8px;
}
.wk-editor-head b { font-size: 16px; }
.wk-editor-head .wk-primary { height: 36px; padding: 0 18px; font-size: 14px; }
.wk-editor-back { background: none; border: 0; color: #fff; font-size: 26px; line-height: 1; padding: 0 6px; }
.wk-editor-media {
  position: relative; flex: 0 0 40svh; background: #000;
  display: grid; place-items: center; overflow: hidden;
}
.wk-editor-media video { width: 100%; height: 100%; object-fit: contain; }
.wk-editor-media .wk-pv-imgs { width: 100%; height: 100%; }
.wk-editor-media .wk-pv-imgs img { height: 100%; width: auto; min-width: 0; object-fit: contain; }
.wk-editor-dur {
  position: absolute; right: 10px; bottom: 10px;
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, .55);
}
.wk-editor-form { flex: 1; padding: 16px; display: grid; gap: 12px; align-content: start; }
.wk-editor-form input, .wk-editor-form textarea {
  width: 100%; padding: 12px 14px; font-size: 14px;
  background: #1c1c1e; border: 1px solid #2c2c2e; border-radius: 12px;
  color: #fff; outline: none; resize: none;
}
.wk-editor-form input:focus, .wk-editor-form textarea:focus { border-color: #fe2c55; }
.wk-editor-note { margin: 2px 0 0; font-size: 11.5px; line-height: 1.6; color: rgba(255, 255, 255, .45); }
.wk-upload {
  position: absolute; left: 16px; right: 16px;
  bottom: calc(env(safe-area-inset-bottom) + 14px);
  padding: 11px 14px; border-radius: 12px; font-size: 12.5px;
  background: rgba(28, 28, 30, .96); border: 1px solid #2c2c2e;
  color: rgba(255, 255, 255, .82);
}
.wk-upload i {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .25); border-top-color: #fe2c55;
  animation: wk-spin .7s linear infinite; margin-right: 8px; vertical-align: -2px;
}
@keyframes wk-spin { to { transform: rotate(360deg); } }

@media (min-width: 721px) {
  body.wk-body { background: #050505; }
  .wk-cam {
    left: 50%; right: auto; width: 560px;
    transform: translateX(-50%);
    border-left: 1px solid #1f1f1f; border-right: 1px solid #1f1f1f;
  }
  .wk-layer { left: 50%; right: auto; width: 560px; transform: translateX(-50%); }
}