﻿/* ============================================================
   氪金兽首页复刻 · 基础层
   Design tokens / reset / app shell / topbar / tabbar
   ============================================================ */

:root {
  /* 品牌色板（取自原站设计变量） */
  --kr-blue-500: #5468ff;
  --kr-blue-400: #7587ff;
  --kr-blue-300: #adbfff;
  --kr-blue-200: #c2d5ff;
  --kr-blue-100: #ecedff;
  --kr-blue-50: #f3f5f9;

  --color-primary: var(--kr-blue-500);
  --color-price: #ff3c3c;
  --color-text: #333;
  --color-text-sub: #666;
  --color-text-weak: #999;
  --color-text-faint: #ccc;
  --color-line: #eee;
  --color-bg: #f3f5f9;
  --color-card: #fff;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --page-gap: 12px;
  --app-width: 450px;
  --tabbar-height: 50px;

  --shadow-card: 0 2px 10px rgba(31, 45, 96, .04);
  --shadow-primary: 0 6px 16px rgba(84, 104, 255, .28);

  --font-base: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0 auto;
  max-width: var(--app-width);
  min-height: 100vh;
  background: #f3f5f9;
  color: var(--color-text);
  font-family: var(--font-base);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: clip;
  position: relative;
  box-shadow: 0 0 20px rgba(0, 0, 0, .06);
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4, p {
  margin: 0;
  font-weight: inherit;
  font-size: inherit;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
  border: 0;
}

svg {
  display: block;
}

/* 图片加载失败时的兜底：淡蓝渐变块，隐藏 alt 文本 */
img.is-broken {
  color: transparent;
  background: linear-gradient(135deg, #eef1ff, #e2e8ff);
}

/* ---------- 页面容器 ---------- */
.page {
  padding: 0 var(--page-gap);
  background: linear-gradient(180deg, #fff 0, #f3f5f9 140px);
}

.spacer {
  height: 64px;
}

/* ---------- 顶部栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 99;
  padding: 0 var(--page-gap) 12px;
  background: #fff;
}

.topbar__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.brand__logo {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
}

.brand__text {
  display: flex;
  flex-direction: column;
  margin-left: 8px;
}

.brand__text b {
  color: #1f2430;
  font-size: 18px;
  font-weight: 800;
  line-height: 20px;
  letter-spacing: .5px;
}

.brand__text i {
  margin-top: 1px;
  color: var(--color-text-sub);
  font-size: 11px;
  font-style: normal;
  line-height: 14px;
  letter-spacing: .2px;
  white-space: nowrap;
}

.kefu {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  padding: 0;
  color: var(--color-text-sub);
}

.kefu svg {
  width: 22px;
  height: 22px;
  color: var(--color-primary);
}

.kefu__text {
  font-size: 9px;
  font-weight: 500;
  line-height: 11px;
  text-align: left;
  white-space: nowrap;
}

.search {
  display: flex;
  align-items: center;
  height: 36px;
  margin: 4px 0 0;
  padding: 0 12px;
  border-radius: var(--radius-md);
  background: #f3f5f9;
  color: var(--color-text-faint);
  font-size: 14px;
}

.search svg {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  color: var(--color-text-weak);
  flex: 0 0 auto;
}

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 100;
  display: flex;
  width: 100%;
  max-width: var(--app-width);
  height: calc(var(--tabbar-height) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transform: translateX(-50%);
  background: #fff;
}

/* 中间“卖账号”上方的白色弧形凸起 */
.tabbar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -27px;
  height: 28px;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 450 28' preserveAspectRatio='none'%3E%3Cpath d='M0 28V27h180.5c6 0 8-17 44.5-17s38.5 17 44.5 17H450v1z' fill='%23fff'/%3E%3C/svg%3E") center bottom / 100% 100% no-repeat;
}

.tabbar__item {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  color: var(--color-text);
  font-size: 12px;
}

.tabbar__item svg {
  width: 22px;
  height: 22px;
}

.tabbar__item.is-active {
  color: var(--color-primary);
}

.tabbar__sell {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  min-width: 0;
  height: var(--tabbar-height);
}

.tabbar__sell-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7b8bff, var(--kr-blue-500) 70%);
  color: #fff;
  box-shadow: 0 5px 12px rgba(84, 104, 255, .26);
}

.tabbar__sell-icon svg {
  width: 16px;
  height: 16px;
}

.tabbar__sell.is-active .tabbar__sell-title {
  color: var(--kr-blue-500);
}

.tabbar__sell-title {
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}

/* ---------- 交互增强 ---------- */
@media (hover: hover) {
  .search:hover {
    background: #eef0f6;
  }

  .kefu:hover {
    color: var(--color-primary);
  }

  .tabbar__item:hover {
    color: var(--color-primary);
  }
}
