/* 字体 */
@font-face {
  font-family: "UKIJ Moy Qelem";
  src: url("../fonts/UKIJMoyQ.ttf") format("truetype");
  font-display: swap;
}

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

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

body {
  background: #ffffff;
  color: #171717;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

h1, h2, h3 {
  font-weight: normal;
}

/* 顶部导航 */
.navbar {
  position: sticky;
  top: 0;
  z-index: 10;
}

.navbar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: -36px;
  z-index: -1;
  background: linear-gradient(135deg, #f6cde4 0%, #ffffff 45%, #bfe4f5 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  pointer-events: none;
}

.navbar-inner {
  max-width: 448px;
  margin: 0 auto;
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
}

.navbar-capsule {
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: 999px;
  padding: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.capsule-btn {
  width: 36px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #404040;
}

.capsule-btn svg {
  width: 15px;
  height: 15px;
  display: block;
}

.capsule-divider {
  width: 1px;
  height: 14px;
  background: #d4d4d4;
}

.navbar-title {
  flex: 1;
  text-align: center;
  font-family: "UKIJ Moy Qelem", "UKIJTor", -apple-system, sans-serif;
  font-size: 26px;
  font-weight: 400;
  color: #171717;
  direction: rtl;
  padding-top: 4px;
}

.navbar-spacer {
  width: 76px;
}

/* 轮播 - 弧形旋转木马 */
.banner-swiper {
  position: relative;
  margin-top: 12px;
  padding: 16px 0 32px;
  overflow: hidden;
  perspective: 1200px;
}

.banner-swiper .swiper-wrapper {
  transform-style: preserve-3d;
}

.banner-swiper .swiper-slide {
  width: 56%;
  transition: transform 0.6s, opacity 0.6s;
  backface-visibility: hidden;
}

.banner-swiper .swiper-slide img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* 快捷菜单 */
.quick-menu {
  display: flex;
  justify-content: space-around;
  padding: 18px 16px 8px;
}

.menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.menu-icon {
  width: 74px;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-icon img {
  width: 60px;
  height: 60px;
  display: block;
}

.menu-icon-lg img {
  width: 74px;
  height: 74px;
}

.menu-title {
  font-size: 13px;
  color: #404040;
  line-height: 1;
}

/* 推荐作品 */
.section {
  padding: 14px 16px 0;
}

.section-title {
  font-size: 17px;
  font-weight: 700;
  color: #1a1a1a;
  text-align: right;
  margin: 0 0 12px;
}

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

.rec-card {
  position: relative;
  display: block;
  border-radius: 14px;
  overflow: hidden;
  background: #f0f0f0;
  -webkit-tap-highlight-color: transparent;
}

.rec-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rec-card:not(.rec-main) {
  aspect-ratio: 16 / 10;
}

.rec-main {
  grid-row: 1 / span 2;
  grid-column: 2;
}

.rec-vip {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
}

.rec-vip svg {
  width: 14px;
  height: 14px;
  color: #ffffff;
}

.rec-vip em {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
}

/* 底部 TabBar */
body {
  padding-bottom: calc(56px + env(safe-area-inset-bottom));
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  height: calc(56px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: #ffffff;
  border-top: 1px solid #f0f0f0;
}

.tabbar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: #9ca3af;
  -webkit-tap-highlight-color: transparent;
}

.tabbar-item svg {
  width: 23px;
  height: 23px;
}

.tabbar-icon {
  width: 24px;
  height: 24px;
  display: block;
}

.tabbar-icon-active {
  display: none;
}

.tabbar-item.is-active .tabbar-icon {
  display: none;
}

.tabbar-item.is-active .tabbar-icon-active {
  display: block;
}

.tabbar-item span {
  font-size: 11px;
  line-height: 1;
}

.tabbar-item.is-active {
  color: #f97316;
}

/* 小说列表 */
.novel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 10px;
}

.novel-card {
  display: block;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.novel-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  background: #f0f0f0;
}

.novel-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.novel-vip {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 7px;
  border-radius: 6px;
  background: linear-gradient(135deg, #f6c343, #f0a020);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.novel-info {
  padding: 8px 2px 0;
  direction: rtl;
  text-align: right;
}

.novel-title {
  font-size: 13px;
  font-weight: 500;
  color: #1a1a1a;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.novel-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #9ca3af;
  line-height: 1;
}

.novel-views::before {
  content: "👁 ";
  margin-right: 2px;
}
