/* ==========================================================
   素材售卖站点 · 前台样式
   风格：蓝白 / 浅蓝渐变，移动端优先，桌面端自适应
   ========================================================== */

:root {
  --blue-50: #f2f7ff;
  --blue-100: #e4efff;
  --blue-200: #cddffd;
  --blue-400: #6f9bff;
  --blue-500: #3d78ff;
  --blue-600: #2f6bff;
  --blue-700: #1f56e0;
  --ink: #14223a;
  --ink-2: #3c4f6d;
  --muted: #7b8ca6;
  --line: #e5edfb;
  --bg: #f4f8ff;
  --white: #fff;
  --green: #12a05f;
  --orange: #ff8a3d;
  --red: #e5484d;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(47, 107, 255, .08);
  --shadow-lg: 0 18px 48px rgba(47, 107, 255, .14);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 15px;
  padding-bottom: calc(66px + env(safe-area-inset-bottom));
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; border: 0; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
ul, ol { list-style: none; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 14px; }

/* ---------------- 顶部栏 ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(240,247,255,.94));
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(222, 234, 252, .9);
}
.topbar-inner {
  max-width: 1120px; margin: 0 auto; padding: 10px 14px;
  display: flex; align-items: center; gap: 12px;
}
.logo { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 11px;
  background: linear-gradient(135deg, #6f9bff, #2f6bff 70%);
  color: #fff; font-weight: 700; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(47,107,255,.3);
}
.logo-text { font-size: 16px; font-weight: 700; letter-spacing: .3px; white-space: nowrap; }
.logo-text small { display: block; font-size: 10px; color: var(--muted); font-weight: 400; letter-spacing: 1px; }

.top-search { flex: 1; position: relative; min-width: 0; }
.top-search input {
  width: 100%; height: 38px; border-radius: 12px; border: 1px solid var(--blue-200);
  background: #fff; padding: 0 70px 0 36px; font-size: 14px; outline: none;
  transition: box-shadow .2s, border-color .2s;
}
.top-search input:focus { border-color: var(--blue-500); box-shadow: 0 0 0 4px rgba(47,107,255,.1); }
.top-search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--blue-500); font-size: 15px; }
.top-search .go {
  position: absolute; right: 4px; top: 4px; height: 30px; padding: 0 12px; border: 0; border-radius: 9px;
  background: linear-gradient(135deg, #6f9bff, #2f6bff); color: #fff; font-size: 13px; cursor: pointer;
}
.top-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.top-actions .user-chip {
  display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); font-size: 13px; color: var(--ink-2);
}
.top-actions .avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--blue-100); }
.btn-line { border: 1px solid var(--blue-200); background: #fff; color: var(--blue-600); border-radius: 10px; padding: 8px 14px; font-size: 13px; }

/* 桌面导航 */
.nav-main { display: none; border-top: 1px solid rgba(222,234,252,.7); background: rgba(255,255,255,.7); }
.nav-main .wrap { display: flex; gap: 26px; }
.nav-main a { padding: 10px 0; font-size: 14px; color: var(--ink-2); position: relative; }
.nav-main a.on { color: var(--blue-600); font-weight: 600; }
.nav-main a.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: var(--blue-600); }

/* ---------------- 首页 Hero ---------------- */
.hero {
  margin: 14px 0 18px; border-radius: 20px; padding: 22px 18px;
  background: radial-gradient(120% 140% at 0% 0%, #ffffff 0%, #eef5ff 42%, #dcebff 100%);
  border: 1px solid #e3eeff; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; right: -40px; top: -50px; width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle, rgba(111,155,255,.35), rgba(111,155,255,0) 70%);
}
.hero h1 { font-size: 22px; line-height: 1.35; letter-spacing: -.5px; }
.hero h1 span { color: var(--blue-600); }
.hero p { font-size: 13px; color: var(--ink-2); margin-top: 8px; max-width: 520px; }
.hero-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; position: relative; z-index: 2; }
.hero-stats { display: flex; gap: 18px; margin-top: 18px; }
.hero-stats div b { display: block; font-size: 18px; color: var(--blue-600); }
.hero-stats div span { font-size: 11px; color: var(--muted); }

/* 公告 */
.notice-bar {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 9px 12px; margin-bottom: 14px; overflow: hidden;
}
.notice-bar .tag {
  flex-shrink: 0; font-size: 11px; color: #fff; padding: 2px 8px; border-radius: 6px;
  background: linear-gradient(135deg, #6f9bff, #2f6bff);
}
.notice-bar .txt { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 轮播 */
.banner {
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin-bottom: 20px; padding-bottom: 4px; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.banner::-webkit-scrollbar { display: none; }
.banner a {
  flex: 0 0 100%; scroll-snap-align: start; border-radius: 16px; overflow: hidden;
  background: linear-gradient(135deg, #e9f2ff, #f7fbff); aspect-ratio: 16 / 8; box-shadow: var(--shadow);
}
.banner a img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------- 分类 / 标签 ---------------- */
.cats { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats a {
  flex: 0 0 auto; padding: 8px 15px; border-radius: 999px; font-size: 13px;
  background: #fff; border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap;
}
.cats a.on { color: #fff; border-color: transparent; background: linear-gradient(135deg, #6f9bff, #2f6bff); box-shadow: 0 8px 18px rgba(47,107,255,.24); }

/* ---------------- 区块标题 ---------------- */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: 20px 0 12px; }
.sec-head h2 { font-size: 18px; letter-spacing: -.3px; }
.sec-head h2 i { font-style: normal; color: var(--blue-600); }
.sec-head a { font-size: 12px; color: var(--muted); }

/* ---------------- 素材卡片 ---------------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.card-m {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 4px 14px rgba(47,107,255,.05); transition: transform .18s, box-shadow .18s;
  display: flex; flex-direction: column;
}
.card-m:active { transform: scale(.99); }
.card-m .cover { position: relative; aspect-ratio: 4 / 3; background: linear-gradient(135deg,#eaf2ff,#f8fbff); overflow: hidden; }
.card-m .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card-m .cover .badge {
  position: absolute; left: 8px; top: 8px; font-size: 10px; padding: 2px 7px; border-radius: 6px;
  background: linear-gradient(135deg,#ff9f5a,#ff7a2f); color: #fff; box-shadow: 0 4px 10px rgba(255,122,47,.3);
}
.card-m .cover .play {
  position: absolute; right: 8px; bottom: 8px; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(19,34,58,.55); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px;
  backdrop-filter: blur(4px);
}
.card-m .body { padding: 9px 10px 11px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-m .title { font-size: 13.5px; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-m .tags { display: flex; gap: 4px; flex-wrap: wrap; }
.card-m .tags i { font-style: normal; font-size: 10px; color: var(--blue-600); background: var(--blue-50); padding: 1px 6px; border-radius: 5px; }
.card-m .foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.card-m .price { font-size: 15px; font-weight: 700; color: var(--blue-600); }
.card-m .price small { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 2px; }
.card-m .meta { font-size: 10.5px; color: var(--muted); }
.card-m .fav {
  border: 0; background: #f3f7ff; color: var(--blue-600); width: 26px; height: 26px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 13px; cursor: pointer;
}
.card-m .fav.on { background: #fff1f0; color: #ff5a5f; }

/* 套餐卡片 */
.card-p .cover { aspect-ratio: 16 / 9; }
.card-p .cover .count { position: absolute; right: 8px; top: 8px; font-size: 10px; background: rgba(255,255,255,.9); color: var(--blue-600); padding: 2px 7px; border-radius: 6px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 44px; padding: 0 18px; border: 0; border-radius: 12px; cursor: pointer;
  background: linear-gradient(135deg, #6f9bff, #2f6bff); color: #fff; font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 22px rgba(47,107,255,.26); transition: .18s;
}
.btn:active { transform: translateY(1px); }
.btn.block { width: 100%; }
.btn.ghost { background: #fff; color: var(--blue-600); border: 1px solid var(--blue-200); box-shadow: none; }
.btn.gray { background: #f2f6fd; color: var(--ink-2); box-shadow: none; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; box-shadow: none; }
.btn.danger { background: linear-gradient(135deg,#ff7d7d,#e5484d); box-shadow: 0 8px 18px rgba(229,72,77,.24); }
.btn.disabled, .btn[disabled] { background: #cdd8ea; color: #fff; box-shadow: none; pointer-events: none; }

/* ---------------- 提示 ---------------- */
.alert { border-radius: 12px; padding: 10px 13px; font-size: 13px; margin-bottom: 14px; line-height: 1.65; }
.alert-success { background: #eefbf3; border: 1px solid #c9f0d8; color: #11794a; }
.alert-error { background: #fff1f0; border: 1px solid #ffd6d2; color: #c0392b; }
.alert-warn { background: #fff8eb; border: 1px solid #ffe2b3; color: #8a5a00; }
.alert-info { background: var(--blue-50); border: 1px solid var(--blue-200); color: var(--blue-700); }

.empty {
  text-align: center; padding: 46px 16px; color: var(--muted); font-size: 13px;
  background: #fff; border: 1px dashed var(--blue-200); border-radius: var(--radius);
}
.empty i { display: block; font-size: 30px; font-style: normal; margin-bottom: 8px; }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--blue-200); border-radius: 12px; background: #fff;
  padding: 11px 13px; outline: none; font-size: 15px; transition: .16s;
}
.field textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue-500); box-shadow: 0 0 0 4px rgba(47,107,255,.1); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.captcha-row input { flex: 1; }
.captcha-row img {
  width: 108px; height: 44px; border-radius: 10px; border: 1px solid var(--blue-200); cursor: pointer; object-fit: cover;
}

/* ---------------- 登录 / 注册 ---------------- */
.auth-page { min-height: calc(100vh - 60px); display: flex; align-items: center; justify-content: center; padding: 20px 0 40px; }
.auth-card {
  width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line);
  border-radius: 20px; padding: 26px 20px; box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.auth-card::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: linear-gradient(90deg, #8fb4ff, #2f6bff, #8fb4ff);
}
.auth-card h1 { font-size: 20px; text-align: center; }
.auth-card .sub { font-size: 12.5px; color: var(--muted); text-align: center; margin: 6px 0 20px; line-height: 1.7; }
.auth-tips { font-size: 12px; color: var(--muted); text-align: center; margin-top: 14px; }
.auth-tips a { color: var(--blue-600); }

/* ---------------- 详情页 ---------------- */
.detail-cover {
  border-radius: 18px; overflow: hidden; background: linear-gradient(135deg,#eaf2ff,#fbfdff);
  border: 1px solid var(--line); position: relative;
}
.detail-cover img { width: 100%; display: block; }
.detail-cover .wm {
  position: absolute; right: 10px; bottom: 10px; font-size: 10px; color: rgba(255,255,255,.9);
  background: rgba(19,34,58,.4); padding: 3px 8px; border-radius: 6px; backdrop-filter: blur(4px);
}
.detail-title { font-size: 20px; font-weight: 700; line-height: 1.4; margin: 14px 0 8px; }
.detail-meta { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.detail-price-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 14px 0;
}
.detail-price { font-size: 22px; font-weight: 700; color: var(--blue-600); }
.detail-price small { font-size: 12px; color: var(--muted); font-weight: 400; }
.detail-tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); margin: 22px 0 14px; }
.detail-tabs a { padding-bottom: 9px; font-size: 14px; color: var(--ink-2); }
.detail-tabs a.on { color: var(--blue-600); font-weight: 600; border-bottom: 2px solid var(--blue-600); }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.thumbs a { border-radius: 10px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 1; background: #f5f9ff; }
.thumbs a img { width: 100%; height: 100%; object-fit: cover; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: 0 4px 14px rgba(47,107,255,.04); }
.panel h3 { font-size: 15px; margin-bottom: 10px; }

.review-item { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.review-item:last-child { border-bottom: 0; }
.review-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.review-head img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.review-stars { color: #ffb020; font-size: 12px; letter-spacing: 1px; }
.review-body { font-size: 13.5px; margin-top: 6px; color: var(--ink-2); line-height: 1.7; }

/* ---------------- 个人中心 ---------------- */
.center-head {
  background: linear-gradient(135deg, #eaf2ff 0%, #ffffff 60%, #e7f0ff 100%);
  border: 1px solid #e2ecfd; border-radius: 18px; padding: 16px; margin: 14px 0;
  display: flex; gap: 13px; align-items: center; box-shadow: var(--shadow);
}
.center-head img { width: 56px; height: 56px; border-radius: 16px; object-fit: cover; background: var(--blue-100); }
.center-head .info { flex: 1; min-width: 0; }
.center-head .info b { font-size: 16px; }
.center-head .info p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.center-head .status { font-size: 11px; padding: 3px 9px; border-radius: 999px; display: inline-block; margin-top: 5px; }
.status-ok { background: #e8f9f0; color: var(--green); }
.status-bad { background: #fff1f0; color: var(--red); }

.tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: 0 0 auto; padding: 8px 14px; border-radius: 10px; font-size: 13px; background: #fff;
  border: 1px solid var(--line); color: var(--ink-2);
}
.tabs a.on { background: linear-gradient(135deg, #6f9bff, #2f6bff); color: #fff; border-color: transparent; }

.order-item {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px;
}
.order-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.order-main { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 8px 0; }
.order-main b { font-size: 14px; }
.order-main .amt { color: var(--blue-600); font-weight: 700; }
.badge-status { font-size: 11px; padding: 2px 8px; border-radius: 6px; }
.st-0 { background: #fff8eb; color: #b8730a; }
.st-1 { background: #e8f9f0; color: var(--green); }
.st-2 { background: #fff1f0; color: var(--red); }

/* 公共主页 */
.profile-hero {
  text-align: center; padding: 28px 16px 20px; border-radius: 20px; margin-top: 14px;
  background: radial-gradient(120% 140% at 50% 0%, #ffffff, #ecf4ff 60%, #dcecff);
  border: 1px solid #e2ecfd; box-shadow: var(--shadow);
}
.profile-hero img { width: 74px; height: 74px; border-radius: 22px; object-fit: cover; margin: 0 auto 10px; background: var(--blue-100); box-shadow: 0 10px 24px rgba(47,107,255,.18); }
.profile-hero h1 { font-size: 18px; }
.profile-hero p { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; max-width: 460px; margin-left: auto; margin-right: auto; }
.profile-stats { display: flex; justify-content: center; gap: 28px; margin-top: 14px; }
.profile-stats b { display: block; font-size: 17px; color: var(--blue-600); }
.profile-stats span { font-size: 11px; color: var(--muted); }

/* ---------------- 底部导航（手机） ---------------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: rgba(255,255,255,.94); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  display: flex;
}
.tabbar a {
  flex: 1; text-align: center; font-size: 11px; color: var(--muted); padding: 4px 0; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.tabbar a i { font-style: normal; font-size: 18px; line-height: 1; }
.tabbar a.on { color: var(--blue-600); font-weight: 600; }

/* ---------------- 分页 ---------------- */
.pager { display: flex; justify-content: center; gap: 6px; margin: 22px 0 10px; flex-wrap: wrap; }
.pager a {
  min-width: 34px; height: 34px; padding: 0 10px; border-radius: 9px; background: #fff;
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--ink-2);
}
.pager a.on { background: linear-gradient(135deg, #6f9bff, #2f6bff); color: #fff; border-color: transparent; }

/* ---------------- 页脚 ---------------- */
.footer { text-align: center; padding: 26px 14px 12px; color: #97a7bf; font-size: 12px; line-height: 1.9; }
.footer a { color: #6a84a6; }

/* ---------------- 桌面端适配 ---------------- */
@media (min-width: 768px) {
  body { padding-bottom: 20px; font-size: 15px; }
  .tabbar { display: none; }
  .nav-main { display: block; }
  .wrap { padding: 0 20px; }
  .topbar-inner { padding: 12px 20px; gap: 18px; }
  .logo-text { font-size: 18px; }
  .top-search { max-width: 420px; }
  .top-search input { height: 40px; }
  .hero { padding: 34px 36px; margin: 20px 0 22px; }
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 14px; }
  .hero-stats { gap: 34px; margin-top: 22px; }
  .banner a { flex: 0 0 calc(50% - 5px); aspect-ratio: 21 / 8; }
  .grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .card-m .title { font-size: 14.5px; }
  .card-m:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
  .card-m:hover .cover img { transform: scale(1.05); }
  .detail-layout { display: grid; grid-template-columns: 1.15fr .85fr; gap: 26px; align-items: start; }
  .detail-title { font-size: 24px; margin-top: 0; }
  .my-layout { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
  .center-head { flex-direction: column; text-align: center; padding: 24px 16px; margin: 0; position: sticky; top: 96px; }
  .center-head .info { text-align: center; }
  .thumbs { grid-template-columns: repeat(4, 1fr); }
  .auth-card { padding: 34px 30px; }
}

/* 超窄屏微调（iPhone SE 等） */
@media (max-width: 380px) {
  .logo-text { font-size: 14px; }
  .logo-text small { display: none; }
  .top-search .go { padding: 0 9px; font-size: 12px; }
  .top-actions .user-chip span { display: none; }
  .hero h1 { font-size: 20px; }
  .card-m .title { font-size: 12.5px; }
}
