/* ==========================================================
   织到手工纺 · 网页版基础样式（PC / 手机共用）
   设计语言参考 Apple：大留白、克制用色、细线分隔、克制阴影
   ========================================================== */

:root {
  --bg: #fbfbfd;
  --bg-soft: #f5f5f7;
  --surface: #ffffff;
  --text: #1d1d1f;
  --text-2: #424245;
  --muted: #6e6e73;
  --muted-2: #86868b;
  --line: rgba(0, 0, 0, .08);
  --border: rgba(0, 0, 0, .08);
  --accent: #0071e3;
  --accent-h: #0077ed;
  --danger: #d70015;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 2px 20px rgba(0, 0, 0, .05);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .14);
  --maxw: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.47;
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
input, select, textarea { outline: none; }
h1, h2, h3, p { margin: 0; }

/* ---------- 版心 ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 44px; padding: 0 24px; border-radius: 980px;
  font-size: 15px; font-weight: 500; letter-spacing: -.01em; white-space: nowrap;
  background: var(--surface); color: var(--text);
  border: 1px solid rgba(0, 0, 0, .14);
  transition: background .22s ease, color .22s ease, border-color .22s ease, transform .22s ease;
}
.btn:hover { background: #f0f0f2; }
.btn:active { transform: scale(.985); }
.btn.primary { background: var(--accent); color: #fff; border-color: transparent; }
.btn.primary:hover { background: var(--accent-h); }
.btn.dark { background: var(--text); color: #fff; border-color: transparent; }
.btn.dark:hover { background: #000; }
.btn.block { width: 100%; }
.btn.sm { height: 36px; padding: 0 18px; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--accent); padding: 0 8px; }
.btn.ghost:hover { text-decoration: underline; background: transparent; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 24px; }

/* ---------- 分类 chips ---------- */
.chips { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 38px; padding: 0 20px; border-radius: 980px;
  background: rgba(0, 0, 0, .05); color: var(--text-2);
  font-size: 14px; letter-spacing: -.01em;
  transition: background .2s ease, color .2s ease;
}
.chip:hover { background: rgba(0, 0, 0, .08); }
.chip.active { background: var(--text); color: #fff; }

/* ---------- 搜索 ---------- */
.search {
  display: flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 16px; border-radius: 980px;
  background: rgba(0, 0, 0, .05);
  transition: background .2s ease, box-shadow .2s ease;
}
.search:focus-within { background: #fff; box-shadow: 0 0 0 3px rgba(0, 113, 227, .16); }
.search svg { width: 17px; height: 17px; color: var(--muted-2); flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 15px; }
.search input::placeholder { color: var(--muted-2); }

/* ---------- 视频卡片 ---------- */
.v-card { display: block; cursor: pointer; }
.v-cover {
  position: relative; width: 100%; aspect-ratio: 4 / 3;
  border-radius: var(--radius); overflow: hidden; background: var(--bg-soft);
}
.v-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s cubic-bezier(.2, .7, .3, 1); }
.v-card:hover .v-cover img { transform: scale(1.035); }
.pin-badge {
  position: absolute; left: 10px; top: 10px; z-index: 2;
  padding: 4px 9px; border-radius: 6px; font-size: 11px; font-weight: 600; letter-spacing: .02em;
  background: rgba(29, 29, 31, .82); color: #fff;
  backdrop-filter: saturate(180%) blur(6px);
}
.lock-badge {
  position: absolute; right: 10px; bottom: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px; border-radius: 980px; font-size: 11px;
  background: rgba(0, 0, 0, .5); color: #fff;
  backdrop-filter: saturate(180%) blur(6px);
}
.v-title {
  margin-top: 12px; font-size: 15px; font-weight: 500; letter-spacing: -.015em;
  color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.v-cat { margin-top: 4px; font-size: 12.5px; color: var(--muted-2); }

/* ---------- 作品卡片 ---------- */
.m-card { display: block; break-inside: avoid; border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.m-pic { position: relative; background: var(--bg-soft); }
.m-pic img { width: 100%; height: auto; }
.m-body { padding: 14px 16px 16px; }
.m-title { font-size: 15px; font-weight: 500; letter-spacing: -.015em; }
.m-intro {
  margin-top: 5px; font-size: 13px; color: var(--muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.m-meta { margin-top: 9px; display: flex; gap: 12px; font-size: 12px; color: var(--muted-2); }

/* ---------- 骨架屏 ---------- */
.skeleton {
  background: linear-gradient(90deg, #f0f0f2 25%, #f7f7f9 37%, #f0f0f2 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
  border-radius: var(--radius);
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- 空状态 / 加载 ---------- */
.empty { padding: 64px 20px; text-align: center; color: var(--muted); font-size: 15px; }
.empty-sub { margin-top: 8px; font-size: 13px; color: var(--muted-2); }
.loading { padding: 28px; text-align: center; color: var(--muted-2); font-size: 13px; }
.no-more { padding: 32px; text-align: center; color: var(--muted-2); font-size: 12.5px; }
.spinner {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, .1); border-top-color: var(--muted);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex; align-items: center; height: 26px; padding: 0 11px;
  border-radius: 980px; background: rgba(0, 0, 0, .05);
  font-size: 12.5px; color: var(--text-2);
}

/* ---------- 弹窗 ---------- */
.mask {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(0, 0, 0, .32);
  backdrop-filter: blur(6px);
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 360px; max-height: 88vh; overflow: auto;
  padding: 26px 24px 22px;
  background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg);
  animation: pop .22s cubic-bezier(.2, .8, .3, 1);
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.modal-title { font-size: 19px; font-weight: 600; letter-spacing: -.02em; text-align: center; }
.modal-sub { margin-top: 6px; font-size: 13.5px; color: var(--muted); text-align: center; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }
.modal-body { font-size: 13.5px; line-height: 1.75; color: var(--text-2); max-height: 56vh; overflow: auto; }
.pwd-input {
  width: 100%; height: 56px; margin-top: 18px; text-align: center;
  border: 1px solid var(--line); border-radius: 14px; background: var(--bg-soft);
  font-size: 24px; font-weight: 600; letter-spacing: .5em; text-indent: .5em;
  transition: border-color .2s, background .2s;
}
.pwd-input:focus { background: #fff; border-color: var(--accent); }
.pwd-error { min-height: 20px; margin-top: 8px; text-align: center; font-size: 12.5px; color: var(--danger); }
.pwd-tip { margin-top: 12px; text-align: center; font-size: 11.5px; color: var(--muted-2); }
.tip { font-size: 12.5px; color: var(--muted-2); line-height: 1.6; }
.strong { font-weight: 600; color: var(--text); }

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed; left: 50%; bottom: 48px; z-index: 300;
  transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  padding: 11px 20px; border-radius: 980px;
  background: rgba(29, 29, 31, .9); color: #fff;
  font-size: 13.5px; letter-spacing: -.01em;
  backdrop-filter: blur(10px);
  animation: pop .2s ease;
}

/* ---------- 表单行 ---------- */
.form-row {
  display: flex; align-items: center; gap: 14px; min-height: 54px;
  border-bottom: 1px solid var(--line);
}
.form-row:last-child { border-bottom: 0; }
.form-label { flex: none; width: 62px; font-size: 14px; color: var(--muted); }
.form-control {
  flex: 1; min-width: 0; border: 0; background: transparent;
  font-size: 15px; text-align: left;
}
select.form-control { appearance: none; -webkit-appearance: none; }

/* ---------- 图片查看层 ---------- */
.viewer {
  position: fixed; inset: 0; z-index: 250; background: rgba(0, 0, 0, .92);
  display: flex; align-items: center; justify-content: center;
  animation: fade .2s ease;
}
.viewer img { max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 4px; }
.viewer-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 20px;
}
.viewer-nav.prev { left: 22px; }
.viewer-nav.next { right: 22px; }
.viewer-close { position: absolute; top: 20px; right: 22px; color: #fff; font-size: 15px; opacity: .8; }
.viewer-count { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); color: rgba(255, 255, 255, .7); font-size: 13px; }

/* ---------- 顶部导航（PC 默认，手机在 m.css 覆盖） ---------- */
.topnav {
  position: sticky; top: 0; z-index: 100;
  height: 64px;
  background: rgba(251, 251, 253, .78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
.topnav-inner {
  height: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 33px;
  display: flex; align-items: center; gap: 51px;
}
.brand { display: flex; align-items: center; flex: none; }
.brand img { height: 38px; width: auto; object-fit: contain; }
.topnav-menu { display: flex; gap: 32px; flex: 1; }
.topnav-menu a {
  font-size: 16px; color: var(--text-2); letter-spacing: -.01em;
  transition: color .2s ease;
}
.topnav-menu a:hover { color: var(--text); }
.topnav-menu a.active { color: var(--text); font-weight: 500; }
.topnav-right { flex: none; display: flex; align-items: center; gap: 14px; }
.nav-login {
  height: 36px; padding: 0 20px; border-radius: 980px;
  display: inline-flex; align-items: center;
  background: var(--accent); color: #fff; font-size: 15px;
  transition: background .2s;
}
.nav-login:hover { background: var(--accent-h); }
.nav-avatar {
  width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex: none;
  background: rgba(0, 0, 0, .06); display: flex; align-items: center; justify-content: center;
  color: var(--muted);
}
.nav-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* 底部 tab 默认隐藏（手机端显示） */
.bottomtab { display: none; }

/* ---------- 版本切换（页脚） ---------- */
.foot-links {
  padding: 34px 0 40px; margin-top: 20px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center;
  font-size: 12.5px; color: var(--muted-2);
}
.foot-links a { color: var(--muted-2); }
.foot-links a:hover { color: var(--text); text-decoration: underline; }
.foot-sep { flex: 1; }

/* ---------- 备案号 ---------- */
.foot-icp { color: var(--muted-2); }
.icp-bar { font-size: 12.5px; color: var(--muted-2); text-align: center; }
.icp-bar a { color: var(--muted-2); }
.icp-bar a:hover { color: var(--text); text-decoration: underline; }

/* ---------- 头像 ---------- */
.avatar-lg {
  position: relative; width: 76px; height: 76px; flex: none; border-radius: 50%; overflow: hidden;
  background: var(--bg-soft); display: flex; align-items: center; justify-content: center; color: var(--muted-2);
  cursor: pointer;
}
.avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg svg { width: 34px; height: 34px; }
.avatar-edit {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 0 5px;
  background: rgba(0, 0, 0, .5); color: #fff; font-size: 10px; text-align: center;
}

/* ---------- 通用工具 ---------- */
.hide { display: none !important; }
.hover-lift { transition: transform .3s cubic-bezier(.2, .7, .3, 1), box-shadow .3s ease; }
@media (hover: hover) {
  .hover-lift:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(0, 0, 0, .1); }
}
