/* ========================================
   phone-browser.css - 查手机浏览器页面样式
   角色视角的浏览历史记录，文字叙述代替网页
   简约白底，贴近手机浏览器历史界面
   ======================================== */

/* ====== 全屏容器 ====== */
.pb-screen {
  position: absolute;
  inset: 0;
  max-width: 100%;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(100%);
  transition: transform .32s cubic-bezier(.4, 0, .2, 1), opacity .32s ease, visibility .32s;
  overflow: hidden;
  overflow-x: hidden;
  box-sizing: border-box;
}
.pb-screen.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}

/* ====== 列表视图 ====== */
.pb-list-view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  transition: transform .3s ease;
}
.pb-list-view.is-hidden {
  transform: translateX(-24%);
}

/* ====== 顶部导航栏 ====== */
.pb-nav {
  flex-shrink: 0;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, .05);
}
.pb-nav__back,
.pb-nav__action {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #4a4a4a;
  cursor: pointer;
  border-radius: 50%;
  transition: background .18s ease;
}
.pb-nav__back:active,
.pb-nav__action:active {
  background: rgba(0, 0, 0, .06);
}
.pb-nav__back svg,
.pb-nav__action svg {
  width: 22px;
  height: 22px;
}
.pb-nav__title {
  font-size: 17px;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: .5px;
}
.pb-nav__right {
  display: flex;
  align-items: center;
}

/* ====== 模拟地址栏 ====== */
.pb-addressbar {
  flex-shrink: 0;
  padding: 8px 14px 4px;
}
.pb-addressbar__box {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  background: #f1f1f3;
  border-radius: 11px;
}
.pb-addressbar__lock {
  width: 14px;
  height: 14px;
  color: #8a8a8a;
  flex-shrink: 0;
}
.pb-addressbar__text {
  font-size: 14px;
  color: #6a6a6a;
}

/* ====== 角色身份提示条 ====== */
.pb-owner-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 6px;
}
.pb-owner-bar__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #d4dde8;
  color: #5a6470;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  flex-shrink: 0;
}
.pb-owner-bar__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pb-owner-bar__info {
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.pb-owner-bar__name {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pb-owner-bar__hint {
  font-size: 13px;
  color: #9a9a9a;
}

/* ====== 列表主体（可滚动） ====== */
.pb-list-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 28px;
}

/* ====== 浏览历史列表 ====== */
.pb-history {
  display: flex;
  flex-direction: column;
}

/* 日期分组标题 */
.pb-day-header {
  padding: 16px 18px 7px;
  font-size: 13px;
  font-weight: 600;
  color: #9a9a9a;
  letter-spacing: .3px;
}

/* 单条浏览记录 */
.pb-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 18px;
  cursor: pointer;
  transition: background .15s ease;
  border-bottom: 1px solid rgba(0, 0, 0, .04);
}
.pb-item:active {
  background: rgba(0, 0, 0, .04);
}

/* 站点 favicon 占位（首字母色块） */
.pb-item__favicon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin-top: 1px;
}
.pb-fav--c1 { background: #6b8cce; }
.pb-fav--c2 { background: #cc7a6b; }
.pb-fav--c3 { background: #6bb0a0; }
.pb-fav--c4 { background: #b08fc4; }
.pb-fav--c5 { background: #cba76b; }
.pb-fav--c6 { background: #7a9a6b; }

/* 记录文字区 */
.pb-item__body {
  flex: 1;
  min-width: 0;
}
.pb-item__title {
  font-size: 14.5px;
  font-weight: 500;
  color: #1a1a1a;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.pb-item__url {
  font-size: 12px;
  color: #9a9a9a;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pb-item__time {
  flex-shrink: 0;
  font-size: 12px;
  color: #b0b0b0;
  margin-top: 2px;
}

/* 搜索记录条目（带放大镜图标） */
.pb-item--search .pb-item__favicon {
  background: #eceef1;
  color: #8a8a8a;
}
.pb-item--search .pb-item__title {
  color: #3a6ea5;
}

/* ====== 加载状态 ====== */
.pb-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  gap: 14px;
}
.pb-loading.is-hidden {
  display: none;
}
.pb-loading__spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(0, 0, 0, .08);
  border-top-color: #6b8cce;
  border-radius: 50%;
  animation: pbSpin .8s linear infinite;
}
@keyframes pbSpin {
  to { transform: rotate(360deg); }
}
.pb-loading__text {
  font-size: 13px;
  color: #9a9a9a;
}

/* ====== 空状态 ====== */
.pb-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 70px 30px;
  gap: 10px;
  text-align: center;
}
.pb-empty__icon {
  width: 52px;
  height: 52px;
  color: #cfcfcf;
}
.pb-empty__text {
  font-size: 15px;
  font-weight: 600;
  color: #7a7a7a;
}
.pb-empty__hint {
  font-size: 12.5px;
  color: #a8a8a8;
}

/* ====== 网页详情视图 ====== */
.pb-detail-view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  transform: translateX(100%);
  opacity: 0;
  visibility: hidden;
  transition: transform .3s cubic-bezier(.4, 0, .2, 1), opacity .3s ease, visibility .3s;
}
.pb-detail-view.is-active {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
}

/* 详情导航栏 */
.pb-detail-nav {
  flex-shrink: 0;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, .05);
}
.pb-detail-nav__back {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #4a4a4a;
  cursor: pointer;
  border-radius: 50%;
  transition: background .18s ease;
}
.pb-detail-nav__back:active {
  background: rgba(0, 0, 0, .06);
}
.pb-detail-nav__back svg {
  width: 22px;
  height: 22px;
}
.pb-detail-nav__title {
  font-size: 17px;
  font-weight: 600;
  color: #1a1a1a;
}
.pb-detail-nav__right {
  width: 38px;
}

/* 详情地址栏 */
.pb-detail-addr {
  flex-shrink: 0;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, .05);
}
.pb-detail-addr__box {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  background: #f1f1f3;
  border-radius: 10px;
}
.pb-detail-addr__lock {
  width: 13px;
  height: 13px;
  color: #8a8a8a;
  flex-shrink: 0;
}
.pb-detail-addr__url {
  font-size: 13px;
  color: #5a5a5a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 详情主体（可滚动） */
.pb-detail-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 22px 22px 36px;
}

/* 网页标题 */
.pb-detail__title {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.4;
  color: #1a1a1a;
  margin: 0 0 10px;
}

/* 站点 · 时间 */
.pb-detail__meta {
  font-size: 12.5px;
  color: #9a9a9a;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, .07);
  margin-bottom: 18px;
}

/* 网页内容摘要 */
.pb-detail__snippet {
  font-size: 15.5px;
  line-height: 1.85;
  color: #3a3a3a;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 浏览动机 */
.pb-detail__note-wrap {
  margin-top: 24px;
  padding: 15px 16px;
  background: #f5f6f8;
  border-radius: 14px;
  border-left: 3px solid #6b8cce;
}
.pb-detail__note-label {
  font-size: 12px;
  font-weight: 600;
  color: #6b8cce;
  margin-bottom: 7px;
  letter-spacing: .5px;
}
.pb-detail__note {
  font-size: 14.5px;
  line-height: 1.7;
  color: #4a4a4a;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 底部只读提示 */
.pb-detail-footer {
  flex-shrink: 0;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(0, 0, 0, .05);
  background: rgba(255, 255, 255, .9);
}
.pb-detail-footer__hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: #a8a8a8;
}

/* ====== 列表/详情视图基础态 ====== */
.pb-list-view,
.pb-detail-view {
  will-change: transform;
}

/* ====== Toast ====== */
.pb-toast {
  position: absolute;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%) translateY(10px);
  background: rgba(30, 30, 30, .92);
  color: #fff;
  font-size: 13px;
  padding: 9px 18px;
  border-radius: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
  z-index: 100;
  pointer-events: none;
  max-width: 80%;
  text-align: center;
}
.pb-toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
