/* 应用内底部面板。替代浏览器原生的 prompt / confirm。

   定位用 absolute + inset:0 而不是 fixed：fixed 相对视口，而这块面板要
   贴的是手机屏。absolute 相对最近的定位祖先，所以真正决定边界的是
   **它挂在谁身上** —— 见 sheet.js 的 ensureHost，必须挂进 .phone__screen。
   （这里原先写着「iframe 就等于那块屏，所以两者恰好一样」。恰好的不是
   定位方式，是挂载点：iframe 一撤，body 就变成了整个浏览器窗口。） */
.sheet {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
}
.sheet[hidden] { display: none; }

.sheet__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 200ms var(--ease, ease);
}
.sheet.is-open .sheet__scrim { opacity: 1; }

/* 和 app 里的大卡片同一套：24 圆角、一道发丝描边、顶部一条内高光。
   高光那条是这套界面认卡片的方式（见 tokens.css 的 --card-hi）——
   少了它，面板就是一块贴在屏幕上的深色矩形，而不是浮在上面的一层。 */
.sheet__panel {
  position: relative;
  width: 100%;
  max-height: 82%;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 24px 24px 0 0;
  background: var(--sb-panel, var(--surface-1));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 -1px 0 rgba(255, 255, 255, 0.07),
    0 -18px 44px rgba(0, 0, 0, 0.55);
  /* 起点在屏幕下方，加上 is-open 才滑上来 */
  transform: translateY(100%);
  transition: transform 240ms var(--ease, cubic-bezier(0.16, 1, 0.3, 1));
}
.sheet.is-open .sheet__panel { transform: translateY(0); }

/* 顶部那道短横：不做成"可拖动"的暗示，只是一个收口 */
.sheet__panel::before {
  content: "";
  position: sticky;
  top: 0;
  display: block;
  width: 36px;
  height: 4px;
  margin: 10px auto 0;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.14);
}

.sheet__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 20px calc(20px + env(safe-area-inset-bottom, 0px));
}

.sheet__head { display: flex; flex-direction: column; gap: 6px; }
.sheet__head strong { font-size: 17px; font-weight: 600; color: var(--sb-text, #f7f7f8); }
.sheet__head p {
  margin: 0;
  color: var(--sb-secondary, #b8b8c0);
  font-size: 13px;
  line-height: 20px;
}

.sheet__input {
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  border: 1px solid var(--sb-line, rgba(255, 255, 255, 0.08));
  border-radius: var(--r-lg);
  background: var(--sb-card, var(--surface-2));
  color: var(--sb-text, #f7f7f8);
  font: 500 15px/1 var(--font-body);
}
.sheet__input:focus {
  outline: none;
  border-color: var(--accent, var(--accent));
}
.sheet__input::placeholder { color: var(--sb-muted, #686872); }

.sheet__field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.sheet__label {
  margin: 0 0 8px;
  color: var(--sb-secondary, #b8b8c0);
  font: 500 12px/1.4 var(--font-body);
}
.sheet__segments {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--sb-line, rgba(255, 255, 255, 0.08));
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.025);
}
.sheet__segment {
  min-height: 44px;
  border: 0;
  border-radius: calc(var(--r-lg) - 5px);
  background: transparent;
  color: var(--sb-secondary, #b8b8c0);
  font: 600 14px/1 var(--font-body);
  cursor: pointer;
}
.sheet__segment.is-selected {
  background: rgba(255, 126, 31, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 143, 56, 0.42);
  color: var(--accent-2, #ff9a3c);
}
.sheet__segment:focus-visible { outline: 2px solid var(--accent-2, #ff9a3c); outline-offset: 1px; }

/* ---- 选项列表 ---- */

.sheet__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 -6px;
}
.sheet__item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-lg);
  background: none;
  color: var(--sb-text, #f7f7f8);
  font: 500 15px/1.4 var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: background-color 140ms var(--ease, ease);
}
/* 图标跟详情菜单里的对齐：同尺寸、同色阶。两个都从播放页那排按钮弹出来，
   一个有图标一个没有，看着就不像一套。 */
.sheet__item > svg {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  color: var(--sb-secondary, #b8b8c0);
}
.sheet__item.is-danger > svg { color: inherit; }
.sheet__item > span { flex: 1 1 auto; min-width: 0; }
.sheet__item small {
  flex: 0 0 auto;
  color: var(--sb-muted, #686872);
  font-size: 12px;
}
.sheet__item:active { background: rgba(255, 255, 255, 0.06); }
.sheet__item:focus-visible { outline: 2px solid var(--accent-2, #ff9a3c); outline-offset: -2px; }
@media (hover: hover) {
  .sheet__item:hover { background: rgba(255, 255, 255, 0.05); }
}
/* 已选中画一个勾，不靠颜色 —— 色弱用户也要看得出选的是哪一项 */
.sheet__item.is-checked::after {
  content: "✓";
  color: var(--accent, var(--accent));
  font-size: 15px;
}
.sheet__item.is-danger { color: #ff6b6b; }

/* ---- 按钮 ---- */

.sheet__actions { display: flex; gap: 10px; }
.sheet__btn {
  flex: 1 1 0;
  min-height: 50px;
  border: 1px solid var(--sb-line, rgba(255, 255, 255, 0.08));
  border-radius: var(--r-lg);
  background: var(--sb-card, var(--surface-2));
  color: var(--sb-text, #f7f7f8);
  font: 600 15px/1 var(--font-body);
  cursor: pointer;
  transition: filter 140ms var(--ease, ease);
}
.sheet__btn--wide { width: 100%; }
.sheet__btn--primary {
  border-color: transparent;
  /* 渐变方向跟 tokens.css 的 --grad-brand 一致（135deg）——
     写成 90deg 的话，它和页面上别的橙色按钮并排时角度对不上。 */
  background: var(--grad-brand, linear-gradient(135deg, var(--accent), var(--accent-2)));
  color: var(--on-brand, #1b1208);
}
.sheet__btn--danger {
  border-color: transparent;
  background: #c0392b;
  color: #fff;
}
.sheet__btn:active { filter: brightness(0.92); }
.sheet__btn:focus-visible { outline: 2px solid var(--accent-2, #ff9a3c); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .sheet__scrim,
  .sheet__panel,
  .sheet__item,
  .sheet__btn,
  .sheet__segment { transition: none; }
  .sheet__panel { transform: none; }
}

/* 内容面板：留言这类「一屏列表」用。
   标题固定在顶，列表自己滚 —— 整个面板一起滚的话，
   写留言那个键会跟着滑出视野。 */
.sheet__body--panel {
  gap: 0;
  padding-bottom: 0;
  max-height: 70vh;
  min-height: 40vh;
}
.sheet__panelhead {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0 12px;
}
.sheet__panelhead strong { font-size: 15px; font-weight: 600; }
.sheet__panelcontrols {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sheet__close {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.055);
  color: var(--sb-secondary, #b8b8c0);
  cursor: pointer;
}
.sheet__close svg { width: 19px; height: 19px; }
.sheet__close:focus-visible { outline: 2px solid var(--accent-2, #ff9a3c); outline-offset: 2px; }
.sheet__btn--slim {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 14px;
  font-size: 13px;
}
.sheet__panelbody {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}
.sheet__panelbody::-webkit-scrollbar { display: none; }

/* 账号级创作历史：整张记录都是一个明确的大触点，完成作品从这里进入修订。 */
.creation-history { min-height: min(62vh, 520px); }
.creation-history__list {
  display: grid;
  gap: 10px;
  padding: 2px 0 14px;
}
.creation-history__item {
  width: 100%;
  min-height: 96px;
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--line-soft, rgba(255,255,255,.12));
  border-radius: 16px;
  background: rgba(255,255,255,.045);
  color: var(--text, #fff);
  text-align: left;
  cursor: pointer;
}
.creation-history__item:focus-visible { outline: 2px solid var(--accent-2, #ff9a3c); outline-offset: 2px; }
.creation-history__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.creation-history__top strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.creation-history__top time { flex: 0 0 auto; color: var(--text-dim, #999); font-size: 11px; }
.creation-history__summary {
  overflow: hidden;
  color: var(--text-dim, #aaa);
  font-size: 12px;
  line-height: 18px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.creation-history__meta { color: var(--accent, #ff7b36); font-size: 11px; font-weight: 600; }
.creation-history__empty { margin: 20px 4px; color: var(--text-dim, #aaa); font-size: 13px; line-height: 20px; }
.creation-history__empty.is-error { color: var(--danger, #ff7070); }

/* 对话框容器拿到焦点时不画环 —— 它不是一个可操作的控件，
   画了环反而像"这里可以按"。里面的按钮该有的环一个不少。 */
.sheet__panel:focus { outline: none; }

/* ---- 微信转发引导 ----
   微信不允许网页替用户发起转发，只能告诉他"点右上角"。
   整层可点关闭 —— 引导层最烦的就是找不到怎么关。

   放在这里而不是 share.css：App 内的分享面板和分享落地页都要用它，
   而落地页不加载 share.css。这两处只能有一份定义。
   absolute 而不是 fixed：App 内它挂在 .phone__screen 里（那块屏就是它的边界），
   落地页挂在 body 上、页面本身不滚动，两边都对。 */
.wxguide {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  padding: 26px 30px;
  background: rgba(5, 5, 7, 0.78);
  backdrop-filter: blur(2px);
  cursor: pointer;
}
.wxguide[hidden] { display: none; }
.wxguide svg {
  width: 46px;
  height: 46px;
  color: #f2eee8;
  animation: wxguide-nudge 1.2s ease-in-out infinite;
}
.wxguide p {
  margin: 0;
  color: #f2eee8;
  font-size: 15px;
  line-height: 1.7;
  text-align: right;
}
@keyframes wxguide-nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@media (prefers-reduced-motion: reduce) {
  .wxguide svg { animation: none; }
}
