/* ==========================================================================
   业务页面样式 — 登录 / 详情 / 发布 / 类型 / 店铺 / 管理台
   ========================================================================== */

/* --------------------------------------------------------------- 通用 */

.btn--sm { height: 34px; padding: 0 14px; font-size: 13.5px; }

.pagehead {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin: 2px 0 16px;
}
.pagehead h1 { margin: 0 0 3px; font-size: clamp(20px, 4.4vw, 26px); font-weight: 600; letter-spacing: -.02em; }
.pagehead p { margin: 0; font-size: 13px; }

.avatar--s { width: 30px; height: 30px; font-size: 13px; }

code {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 12.5px; padding: 1px 5px; border-radius: 4px;
  background: var(--surface-2); color: var(--accent-ink);
}

/* --------------------------------------------------------- 用户身份条 */

.userchip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 12px 0 4px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line);
  transition: background .16s var(--ease-out);
}
.userchip:hover { background: var(--surface-2); }
.userchip__av {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 600;
}
.userchip__name { font-size: 13.5px; font-weight: 500; }
.userchip__role {
  font-size: 11px; padding: 1px 7px; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent-ink);
}

/* -------------------------------------------------------------- 卡片 */

.card__del {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink-2);
  background: rgba(255, 255, 255, .86); backdrop-filter: blur(6px);
  box-shadow: 0 1px 4px rgba(28, 24, 20, .12);
  transition: transform .14s var(--ease-out), background .16s var(--ease-out), color .16s var(--ease-out);
}
.card__del:active { transform: scale(.9); }
.card__del:hover { background: var(--accent); color: #fff; }

.card__owner {
  display: block; margin-top: 5px; padding-top: 6px;
  border-top: 1px dashed var(--line);
  font-size: 12px; color: var(--ink-3);
}
.card__owner::before { content: '店铺 '; }

.taglist { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 6px; }
.taglist--s { gap: 4px; margin: 0 0 7px; }
/* 品牌标签：高级黑色胶囊样式 */
.tagchip {
  font-size: 11px; letter-spacing: .06em; padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--ink); color: #fff; border: 0;
  font-weight: 500; line-height: 1.5;
}
.tagchip--s {
  font-size: 10px; letter-spacing: .04em; padding: 1.5px 7px;
  background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--line);
}
.tagchip--edit { display: inline-flex; align-items: center; gap: 4px; padding-right: 5px; }
.tagchip--edit button {
  width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center;
  color: rgba(255, 255, 255, .72); font-size: 14px; line-height: 1;
}
.tagchip--edit button:hover { background: rgba(255, 255, 255, .18); color: #fff; }

/* ---------------------------------------------------------- 商品详情 */

.detail { display: grid; gap: 18px; }
.detail__gal { display: grid; gap: 8px; }
.detail__main {
  position: relative; display: block; overflow: hidden;
  border-radius: var(--r-lg); background: var(--surface-2);
  aspect-ratio: 1 / 1;
}
.detail__main img { width: 100%; height: 100%; object-fit: cover; }
.detail__zoom {
  position: absolute; left: 12px; bottom: 12px;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: var(--r-pill);
  background: rgba(20, 19, 17, .55); color: #fff; font-size: 12px;
  backdrop-filter: blur(6px);
}
.detail__thumbs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.detail__thumbs::-webkit-scrollbar { display: none; }
.detail__thumb {
  flex: none; width: 62px; aspect-ratio: 1/1; border-radius: var(--r-sm);
  overflow: hidden; border: 2px solid transparent; background: var(--surface-2);
  transition: border-color .16s var(--ease-out), transform .16s var(--ease-out);
}
.detail__thumb img { width: 100%; height: 100%; object-fit: cover; }
.detail__thumb.is-on { border-color: var(--ink); }
.detail__thumb:active { transform: scale(.94); }

.detail__info { display: grid; gap: 10px; align-content: start; }
.detail__cat {
  justify-self: start; font-size: 12px; padding: 3px 10px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.detail__info h1 { margin: 0; font-size: clamp(19px, 4vw, 24px); font-weight: 600; letter-spacing: -.02em; line-height: 1.3; }
.detail__price { font-size: 24px; font-weight: 600; color: var(--accent); letter-spacing: -.01em; }
.detail__price .muted { font-size: 15px; font-weight: 400; }
.detail__desc { padding-top: 12px; border-top: 1px solid var(--line); }
.detail__desc h3 { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.detail__desc p { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.75; }

.detail__owner {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; border-radius: var(--r-md); background: var(--surface-2);
}
.detail__owner .avatar { flex: none; }
.detail__owner > div { flex: 1; min-width: 0; }
.detail__ownername { font-size: 14px; font-weight: 500; }
.detail__ops { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.detail__ops .btn--primary { grid-column: 1 / -1; }

/* ---------------------------------------------------------- 发布商品 */

.uploader { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.uploader__item {
  position: relative; aspect-ratio: 1/1; border-radius: var(--r-md);
  overflow: hidden; background: var(--surface-2);
}
.uploader__item img { width: 100%; height: 100%; object-fit: cover; }
.uploader__cover {
  position: absolute; left: 6px; bottom: 6px;
  padding: 2px 7px; border-radius: var(--r-sm);
  background: var(--ink); color: #fff; font-size: 11px;
}
.uploader__x {
  position: absolute; right: 5px; top: 5px;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 15px; line-height: 1;
  background: rgba(20, 19, 17, .55); color: #fff;
}
.uploader__add {
  aspect-ratio: 1/1; border-radius: var(--r-md);
  border: 1.5px dashed var(--line-2); background: var(--surface-2);
  display: grid; place-items: center; gap: 3px; cursor: pointer;
  color: var(--ink-3); font-size: 12px;
  transition: border-color .16s var(--ease-out), color .16s var(--ease-out);
}
.uploader__add:hover { border-color: var(--ink-3); color: var(--ink-2); }

.picker { border-top: 1px solid var(--line); padding-top: 12px; }
.picker__head { font-size: 12.5px; color: var(--ink-3); margin-bottom: 8px; }
.picker__grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 6px; max-height: 168px; overflow-y: auto; padding-right: 2px;
}
.picker__item {
  aspect-ratio: 1/1; border-radius: var(--r-sm); overflow: hidden;
  border: 2px solid transparent; background: var(--surface-2);
  transition: transform .14s var(--ease-out), border-color .16s var(--ease-out);
}
.picker__item img { width: 100%; height: 100%; object-fit: cover; }
.picker__item:active { transform: scale(.93); }
.picker__item.is-on { border-color: var(--accent); }

.taginput {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 7px 9px; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--surface-2);
}
.taginput input {
  flex: 1; min-width: 110px; border: 0; background: none; outline: none;
  font-size: 14px; color: var(--ink);
}
.taginput input::placeholder { color: var(--ink-3); }

.inline-form { display: flex; gap: 8px; }
.inline-form input {
  flex: 1; padding: 10px 12px; border: 1px solid var(--line-2);
  border-radius: var(--r-sm); background: var(--surface-2); color: var(--ink);
}
.inline-form input:focus { outline: none; border-color: var(--ink-3); background: var(--surface); }
.inline-form .btn { flex: none; }

/* ---------------------------------------------------------- 类型管理 */

.catlist { display: grid; gap: 8px; }
.catlist__row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2);
}
.catlist__name { font-size: 14px; font-weight: 500; }
.catlist__row .mini:disabled { opacity: .35; cursor: not-allowed; }

/* 分类筛选九宫格 */
.catgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.catgrid__item {
  height: 44px; border-radius: var(--r-md);
  display: grid; place-items: center; padding: 0 6px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--ink-2); font-size: 13.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: transform .14s var(--ease-out), background .16s var(--ease-out),
              border-color .16s var(--ease-out), color .16s var(--ease-out);
}
.catgrid__item:active { transform: scale(.96); }
.catgrid__item.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* -------------------------------------------------------------- 店铺 */

.shophead {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 16px; border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow-1); margin-bottom: 16px;
}
.shophead .avatar { flex: none; width: 52px; height: 52px; font-size: 19px; }
.shophead__main { flex: 1; min-width: 0; }
.shophead h1 { margin: 0 0 2px; font-size: 18px; font-weight: 600; }
.shophead p { margin: 0; font-size: 12.5px; }

.userlist { display: grid; gap: 8px; }
.userlist__row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center;
  padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2);
  text-align: left; transition: background .16s var(--ease-out);
}
.userlist__row:hover { background: var(--surface); box-shadow: var(--shadow-1); }
.userlist__name { font-size: 14px; font-weight: 500; }

/* ------------------------------------------------------------ 管理台 */

.utable { display: grid; gap: 8px; }
.utable__row {
  display: grid; grid-template-columns: auto 1fr auto auto auto; gap: 10px;
  align-items: center; padding: 10px 12px; border-radius: var(--r-md);
  background: var(--surface-2);
}
.utable__name { font-size: 14px; font-weight: 500; }
.utable__role {
  margin-left: 6px; font-size: 11px; padding: 1px 7px; border-radius: var(--r-pill);
  background: var(--line); color: var(--ink-2);
}
.utable__role.is-admin { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------------------------------------------------------- 登录注册 */

.auth {
  min-height: calc(100dvh - 40px);
  display: grid; place-items: center; padding: 24px 16px 40px;
}
.auth__card {
  width: 100%; max-width: 380px;
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--shadow-2); padding: 26px 22px 22px;
  animation: rise .4s var(--ease) both;
}
.auth__brand { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.auth__brand strong { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.tabs--auth { margin-bottom: 18px; }
.auth__hint {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-3); line-height: 1.9;
}
.auth__hint p { margin: 0; }

.captcha { display: grid; grid-template-columns: 120px 1fr auto; gap: 8px; align-items: center; }
.captcha canvas {
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  cursor: pointer; display: block; width: 120px; height: 44px;
}
.captcha input {
  padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--ink); letter-spacing: .12em;
  text-transform: uppercase; min-width: 0;
}
.captcha input:focus { outline: none; border-color: var(--ink-3); background: var(--surface); }
.captcha__re {
  font-size: 12.5px; color: var(--ink-2); padding: 6px 8px;
  border-radius: var(--r-sm); white-space: nowrap;
}
.captcha__re:hover { background: var(--surface-2); }

/* --------------------------------------------------------- 断点适配 */

@media (min-width: 640px) {
  .uploader { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 900px) {
  .detail { grid-template-columns: 1.05fr .95fr; gap: 28px; align-items: start; }
  .detail__gal { position: sticky; top: 130px; }
  .detail__ops { grid-template-columns: repeat(3, 1fr); }
  .detail__ops .btn--primary { grid-column: 1 / -1; }
  .uploader { grid-template-columns: repeat(5, 1fr); }
  .auth { min-height: calc(100dvh - 60px); }
}

/* ==========================================================================
   搜索方式切换 + 类型快捷管理
   ========================================================================== */

.search { position: relative; }
.search__mode {
  position: absolute; left: 6px; top: 50%; transform: translateY(-50%); z-index: 2;
  height: 28px; padding: 0 11px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--ink-2);
  border: 1px solid var(--line-2); font-size: 12.5px; white-space: nowrap;
  transition: background .16s var(--ease-out), color .16s var(--ease-out),
              border-color .16s var(--ease-out), transform .14s var(--ease-out);
}
.search__mode:active { transform: translateY(-50%) scale(.94); }
.search__mode[aria-pressed="true"] {
  background: var(--ink); color: #fff; border-color: var(--ink);
}
.search__input { padding-left: 68px; }

.chip--add {
  width: 32px; padding: 0; justify-content: center;
  color: var(--ink-3); border-style: dashed;
}
.chip--add:hover { color: var(--ink); border-color: var(--ink-3); }

/* ==========================================================================
   头像 / 视频 / 审核 / 页脚 / 手机端框架
   ========================================================================== */

.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.userchip__av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar--lg { width: 64px; height: 64px; font-size: 22px; }

.avatarpick { display: flex; align-items: center; gap: 14px; }
.avatarpick .avatar { flex: none; }
.avatarpick__ops { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.avatarpick__ops p { width: 100%; margin: 0; font-size: 12px; }

.linkbtn {
  display: inline-block; margin-bottom: 12px;
  font-size: 13px; color: var(--ink-2); text-decoration: underline;
  text-underline-offset: 3px;
}
.linkbtn:hover { color: var(--ink); }

.auth__notice {
  margin: -4px 0 12px; padding: 9px 12px; border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--ink-2); font-size: 12.5px;
}
.field__err { color: var(--accent); font-size: 12.5px; }
.field__ok {
  display: block; margin: -4px 0 12px; padding: 9px 12px;
  border-radius: var(--r-sm); background: #eaf3e6; color: #2f6b1f; font-size: 12.5px;
}

.videolist { display: grid; gap: 8px; }
.videolist__row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center;
  padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2);
}
.videolist__name { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.videos { display: grid; gap: 12px; margin-top: 12px; }
.videos__item { border-radius: var(--r-md); overflow: hidden; background: var(--dark); }
.videos__item video { width: 100%; display: block; max-height: 320px; background: var(--dark); }
.videos__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; background: var(--surface-2);
}
.videos__name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.confirmrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.utable__ops { display: flex; gap: 6px; }
.rlist { display: grid; gap: 10px; }
.rlist__row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center;
  padding: 11px 12px; border-radius: var(--r-md); background: var(--surface-2);
}
.rlist__name { font-size: 14px; font-weight: 500; }

/* ------------------------------------------------------------------ 页脚 */

.sitefoot {
  max-width: 1400px; margin: 0 auto;
  padding: 24px 18px 28px; text-align: center;
  border-top: 1px solid var(--line);
}
.sitefoot p { margin: 0 0 6px; font-size: 11.5px; color: var(--ink-3); line-height: 1.7; }
.sitefoot__brand {
  font-size: 13px !important; color: var(--ink-2) !important;
  font-weight: 600; letter-spacing: .02em; margin-bottom: 8px !important;
}

/* ------------------------------------------------- 手机端专用布局（≥768） */

@media (min-width: 768px) {
  html { background: #e8e6e1; }
  body {
    background: var(--bg);
    max-width: 430px; margin: 0 auto;
    box-shadow: 0 0 0 1px rgba(28, 24, 20, .07), 0 18px 60px rgba(28, 24, 20, .14);
    padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    position: relative;
  }
  /* 视口级覆盖：手机宽度内一律保持单手布局 */
  .appbar, main, .sitefoot { max-width: 430px; margin-left: auto; margin-right: auto; }
  .tabbar { max-width: 430px; left: 0; right: 0; margin: 0 auto; }
  .fab { right: calc(50% - 215px + 16px); }
  .viewer { max-width: 430px; left: 0; right: 0; margin: 0 auto; }
  .sheet { max-width: 430px; left: 0; right: 0; margin: 0 auto; }
  .toast { max-width: 380px; }

  .desknav { display: none; }
  .album, .album.is-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); columns: 2; }
  .detail { grid-template-columns: 1fr; gap: 18px; }
  .detail__gal { position: static; }
  .checkout-grid { grid-template-columns: 1fr; }
  .uploader { grid-template-columns: repeat(3, 1fr); }
  .main, main { padding-left: 10px; padding-right: 10px; }
}

