/* ============================================
   VIVID CARTOON THEME - Homepage
   活力卡通风 - 首页
   ============================================ */

/* --- Header --- */
.v-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--v-border-light);
  transition: box-shadow var(--v-duration-normal) var(--v-ease-smooth);
}

.v-header--scrolled {
  box-shadow: 0 4px 20px rgba(255, 107, 107, 0.08);
}

.v-header__inner {
  display: flex;
  align-items: center;
  height: 68px;
  gap: var(--v-space-lg);
}

.v-header__logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--v-space-sm);
  text-decoration: none;
}

.v-header__logo-img {
  height: 36px;
  width: auto;
  transition: transform var(--v-duration-normal) var(--v-ease-bounce);
}

.v-header__logo:hover .v-header__logo-img {
  transform: scale(1.05);
}

.v-header__logo-text {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--v-coral), var(--v-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.v-header__nav {
  display: flex;
  align-items: center;
  gap: var(--v-space-xs);
  flex: 1;
}

.v-header__nav-item {
  position: relative;
  padding: 8px 18px;
  border-radius: var(--v-radius-pill);
  font-size: 15px;
  font-weight: 500;
  color: var(--v-text);
  transition: all var(--v-duration-fast) var(--v-ease-smooth);
}

.v-header__nav-item:hover {
  color: var(--v-coral);
  background: rgba(255, 107, 107, 0.06);
}

.v-header__nav-item--active {
  color: var(--v-coral);
  background: rgba(255, 107, 107, 0.1);
  font-weight: 600;
}

.v-header__search {
  width: 240px;
  flex-shrink: 0;
  transition: width var(--v-duration-normal) var(--v-ease-smooth);
}

.v-header__search:focus-within {
  width: 320px;
}

.v-header__user {
  display: flex;
  align-items: center;
  gap: var(--v-space-md);
  flex-shrink: 0;
}

.v-header__user-action {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--v-text-secondary);
  transition: all var(--v-duration-fast) var(--v-ease-smooth);
  position: relative;
}

/* Tooltip on hover */
.v-header__user-action[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 8px;
  padding: 5px 12px;
  border-radius: var(--v-radius-xs);
  background: var(--v-bg-dark);
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--v-duration-fast) var(--v-ease-smooth);
  z-index: 300;
}
.v-header__user-action[data-tooltip]:hover::after {
  opacity: 1;
}

.v-header__user-action:hover {
  color: var(--v-coral);
  background: rgba(255, 107, 107, 0.08);
}

/* --- Header Dropdowns (McCMS base.js compatibility) --- */
.v-header__user-action {
  position: relative;
}

/* Search dropdown */
.in-dialog--search {
  position: absolute;
  top: 100%;
  right: 0;
  width: 340px;
  margin-top: 8px;
  background: var(--v-bg-card);
  border-radius: var(--v-radius-md);
  box-shadow: var(--v-shadow-lg);
  border: 1px solid var(--v-border-light);
  z-index: 200;
  padding: var(--v-space-md);
}
.in-dialog--search .dialog-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--v-text);
  margin-bottom: var(--v-space-sm);
}
.search-hot {
  display: flex;
  flex-direction: column;
}
.search-hot__item {
  padding: var(--v-space-sm) 0;
}
.search-item__name {
  font-size: 13px;
  color: var(--v-text-secondary);
  display: flex;
  align-items: center;
  gap: var(--v-space-sm);
}
.search-item__name .num {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--v-bg-section);
  color: var(--v-text-muted);
}
.search-item__name .num--1 { background: linear-gradient(135deg, #FFD700, #FFA500); color: #fff; }
.search-item__name .num--2 { background: linear-gradient(135deg, #C0C0C0, #A8A8A8); color: #fff; }
.search-item__name .num--3 { background: linear-gradient(135deg, #CD7F32, #B87333); color: #fff; }
.search-item__detail {
  display: none !important;
}

/* History / Collection dropdowns */
.in-dialog--his,
.in-dialog--coll {
  position: absolute;
  top: 100%;
  right: -20px;
  width: 320px;
  margin-top: 12px;
  background: var(--v-bg-card);
  border-radius: var(--v-radius-md);
  box-shadow: var(--v-shadow-lg);
  border: 1px solid var(--v-border-light);
  z-index: 200;
  padding: var(--v-space-md);
}
.in-dialog__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--v-text);
  margin-bottom: var(--v-space-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.in-dialog__title .more {
  font-size: 12px;
  color: var(--v-text-muted);
  font-weight: 400;
}
.in-dialog__offline {
  font-size: 13px;
  color: var(--v-text-secondary);
  padding: var(--v-space-lg) 0;
  text-align: center;
}
.in-dialog__offline .hl {
  color: var(--v-coral);
  font-weight: 500;
}
.in-dialog__user-list {
  list-style: none;
  max-height: 300px;
  overflow-y: auto;
}
.in-dialog__user-list .list-item {
  display: flex;
  align-items: center;
  gap: var(--v-space-sm);
  padding: var(--v-space-sm) 0;
  border-bottom: 1px solid var(--v-border-light);
}
.in-dialog__user-list .list-item:last-child {
  border-bottom: none;
}
.in-dialog__user-list .list-item .cover {
  flex-shrink: 0;
  width: 40px;
  height: 54px;
  border-radius: var(--v-radius-xs);
  overflow: hidden;
}
.in-dialog__user-list .list-item .cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.in-dialog__user-list .list-item .comic-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--v-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}
.in-dialog__user-list .list-item .read-at,
.in-dialog__user-list .list-item .update {
  font-size: 12px;
  color: var(--v-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.in-dialog__user-list .list-item .read {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--v-coral);
  white-space: nowrap;
}
.in-dialog__empty {
  font-size: 13px;
  color: var(--v-text-muted);
  padding: var(--v-space-lg) 0;
  text-align: center;
}
.in-dialog__empty .hl {
  color: var(--v-coral);
}

/* Triangle pointer for dropdowns */
.triangle {
  position: absolute;
  top: -6px;
  right: 24px;
  width: 12px;
  height: 12px;
  font-size: 0;
  line-height: 0;
}
.triangle .iconfont {
  font-size: 16px;
  color: var(--v-bg-card);
}
.in-dialog--his .triangle,
.in-dialog--coll .triangle {
  right: 30px;
}

/* Avatar dropdown */
.dialog__header-avatar {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 200;
}
.dialog__header-avatar .in-dialog--avatar {
  width: 260px;
  margin-top: 12px;
  background: var(--v-bg-card);
  border-radius: var(--v-radius-md);
  box-shadow: var(--v-shadow-lg);
  border: 1px solid var(--v-border-light);
  overflow: hidden;
}
.in-dialog--avatar .row-1 {
  padding: var(--v-space-md);
  background: linear-gradient(135deg, var(--v-coral), var(--v-pink));
  color: #fff;
}
.in-dialog--avatar .base-info {
  display: flex;
  align-items: center;
  gap: var(--v-space-sm);
  flex-wrap: wrap;
}
.in-dialog--avatar .nickname {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.in-dialog--avatar .vip-tag {
  display: none;
}
.in-dialog--avatar .active-vip .vip-tag {
  display: inline-block;
}
.in-dialog--avatar .logout {
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
}
.in-dialog--avatar .logout:hover {
  color: #fff;
}
.in-dialog--avatar .expire {
  font-size: 12px;
  color: rgba(255,255,255,0.8);
  margin-top: 4px;
}
.in-dialog--avatar .buy-vip {
  display: inline-block;
  padding: 2px 12px;
  border-radius: var(--v-radius-pill);
  border: 1px solid rgba(255,255,255,0.6);
  color: #fff;
  font-size: 12px;
  margin-top: 4px;
  cursor: pointer;
  transition: all var(--v-duration-fast) var(--v-ease-smooth);
}
.in-dialog--avatar .buy-vip:hover {
  background: rgba(255,255,255,0.2);
  border-color: #fff;
}
.in-dialog--avatar .row-2 {
  display: flex;
  align-items: center;
  padding: var(--v-space-md);
  gap: var(--v-space-lg);
}
.in-dialog--avatar .fund-item {
  display: flex;
  align-items: center;
  gap: var(--v-space-sm);
  font-size: 0;
}
.in-dialog--avatar .fund-item__icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.in-dialog--avatar .fund-item__icon .icon-user-yb {
  color: var(--v-coral);
}
.in-dialog--avatar .fund-item__icon .icon-user-yp {
  color: var(--v-teal);
}
.in-dialog--avatar .fund-item__info {
  font-size: 12px;
  color: var(--v-text-muted);
  line-height: 1.4;
}
.in-dialog--avatar .fund-item__info span {
  color: var(--v-text);
  font-weight: 600;
}

/* --- Utility Classes (McCMS compatibility) --- */
.fl { float: left; }
.clearfix::after { content: ''; display: table; clear: both; }
.hl { color: var(--v-coral); }

/* Icon font fallback for triangle arrows */
.iconfont { font-family: inherit; font-style: normal; }

/* --- Banner --- */
.v-banner {
  padding: var(--v-space-xl) 0;
}

.v-banner__layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--v-space-lg);
  border-radius: var(--v-radius-lg);
  overflow: hidden;
}

.v-banner__main {
  position: relative;
  border-radius: var(--v-radius-lg);
  overflow: hidden;
}

.v-banner__side {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.v-banner__side-item {
  position: relative;
  border-radius: var(--v-radius-sm);
  overflow: hidden;
  height: 380px;
  cursor: pointer;
  transition: transform var(--v-duration-normal) var(--v-ease-bounce);
}

.v-banner__slide {
  position: relative;
  width: 100%;
  height: 100%;
}

.v-banner__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.v-banner__slide-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--v-space-xl);
}

.v-banner__slide-title {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin-bottom: var(--v-space-sm);
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.v-banner__slide-meta {
  font-size: 14px;
  color: rgba(255,255,255,0.8);
}

.v-banner__side-item:hover {
  transform: scale(1.03);
}

.v-banner__side-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.v-banner__side-item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--v-space-sm) var(--v-space-md);
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

/* Banner empty state */
.v-banner--empty {
  height: 380px;
  border-radius: var(--v-radius-lg);
  background: linear-gradient(135deg, var(--v-bg-section) 0%, var(--v-bg-section-alt) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Category Navigation --- */
.v-cate-nav {
  padding: var(--v-space-lg) 0;
}

.v-cate-nav__groups {
  display: flex;
  flex-wrap: wrap;
  gap: var(--v-space-lg);
  padding: var(--v-space-lg) var(--v-space-xl);
  background: var(--v-bg-card);
  border-radius: var(--v-radius-md);
  box-shadow: var(--v-shadow-sm);
}

.v-cate-nav__group {
  display: flex;
  align-items: center;
  gap: var(--v-space-sm);
}

.v-cate-nav__label {
  font-size: 14px;
  font-weight: 700;
  color: var(--v-text);
  flex-shrink: 0;
}

.v-cate-nav__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--v-space-xs);
}

/* --- Comic Grid --- */
.v-comic-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--v-space-lg);
}

.v-comic-grid--5 {
  grid-template-columns: repeat(5, 1fr);
}

.v-comic-grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

.v-comic-grid--featured {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--v-space-md);
}

.v-comic-grid--featured .v-card--comic:first-child {
  grid-column: 1 / 2;
  grid-row: 1 / 3;
}

.v-comic-grid--featured .v-card--comic:first-child .v-card__cover {
  padding-top: 0;
  aspect-ratio: 3 / 4;
}

/* Section with carousel */
.v-section__carousel {
  position: relative;
}

.v-section__carousel .v-card--comic {
  min-width: 180px;
}

/* --- Ranking Row --- */
.v-rank-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--v-space-lg);
}

.v-rank-panel {
  background: var(--v-bg-card);
  border-radius: var(--v-radius-md);
  box-shadow: var(--v-shadow-sm);
  overflow: hidden;
}

.v-rank-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--v-space-md) var(--v-space-lg);
  border-bottom: 1px solid var(--v-border-light);
}

.v-rank-panel__title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--v-space-sm);
}

.v-rank-panel__list {
  padding: var(--v-space-sm) var(--v-space-md);
}

.v-rank-panel__item {
  display: flex;
  align-items: center;
  padding: var(--v-space-sm);
  gap: var(--v-space-sm);
  border-radius: var(--v-radius-sm);
  transition: background var(--v-duration-fast) var(--v-ease-smooth);
}

.v-rank-panel__item:hover {
  background: rgba(255, 107, 107, 0.04);
}

.v-rank-panel__num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: var(--v-radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--v-text-muted);
}

.v-rank-panel__num--1 { background: linear-gradient(135deg, #FFD700, #FFA500); }
.v-rank-panel__num--2 { background: linear-gradient(135deg, #C0C0C0, #A8A8A8); }
.v-rank-panel__num--3 { background: linear-gradient(135deg, #CD7F32, #B87333); }

.v-rank-panel__cover {
  flex-shrink: 0;
  width: 40px;
  height: 54px;
  border-radius: var(--v-radius-xs);
  overflow: hidden;
}

.v-rank-panel__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.v-rank-panel__info {
  flex: 1;
  min-width: 0;
}

.v-rank-panel__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--v-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v-rank-panel__author {
  font-size: 12px;
  color: var(--v-text-muted);
}

/* --- Recent Updates + Sidebar --- */
.v-recent-row {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--v-space-lg);
}

.v-recent-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--v-space-md);
}

.v-recent-item {
  display: flex;
  gap: var(--v-space-md);
  padding: var(--v-space-md);
  background: var(--v-bg-card);
  border-radius: var(--v-radius-sm);
  box-shadow: var(--v-shadow-sm);
  transition: all var(--v-duration-normal) var(--v-ease-smooth);
}

.v-recent-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--v-shadow-md);
}

.v-recent-item__cover {
  flex-shrink: 0;
  width: 64px;
  height: 86px;
  border-radius: var(--v-radius-xs);
  overflow: hidden;
}

.v-recent-item__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.v-recent-item__info {
  flex: 1;
  min-width: 0;
}

.v-recent-item__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--v-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v-recent-item__chapter {
  font-size: 12px;
  color: var(--v-coral);
  margin-top: 4px;
}

.v-recent-item__time {
  font-size: 12px;
  color: var(--v-text-muted);
  margin-top: 4px;
}

/* --- Friends Links --- */
.v-friends {
  padding: var(--v-space-xl) 0;
}

.v-friends__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--v-space-sm);
}

.v-friends__link {
  padding: 6px 16px;
  border-radius: var(--v-radius-pill);
  font-size: 13px;
  color: var(--v-text-secondary);
  background: var(--v-bg-card);
  border: 1px solid var(--v-border-light);
  transition: all var(--v-duration-fast) var(--v-ease-smooth);
}

.v-friends__link:hover {
  color: var(--v-coral);
  border-color: var(--v-coral);
  background: rgba(255, 107, 107, 0.04);
}

/* --- Footer --- */
.v-footer {
  background: var(--v-bg-dark);
  color: rgba(255,255,255,0.7);
  padding-top: 0;
}

.v-footer__wave {
  margin-top: -1px;
}

.v-footer__content {
  padding: var(--v-space-2xl) 0 var(--v-space-xl);
}

.v-footer__top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--v-space-2xl);
  margin-bottom: var(--v-space-2xl);
}

.v-footer__brand-name {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: var(--v-space-sm);
}

.v-footer__brand-desc {
  font-size: 14px;
  line-height: 1.6;
}

.v-footer__col-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin-bottom: var(--v-space-md);
}

.v-footer__col-links {
  display: flex;
  flex-direction: column;
  gap: var(--v-space-sm);
}

.v-footer__col-link {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  transition: color var(--v-duration-fast) var(--v-ease-smooth);
}

.v-footer__col-link:hover {
  color: var(--v-coral-light);
}

.v-footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: var(--v-space-lg) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}

/* Back to top */
.v-back-top {
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--v-coral);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--v-shadow-md);
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--v-duration-normal) var(--v-ease-bounce);
  z-index: 90;
}

.v-back-top--visible {
  opacity: 1;
  transform: translateY(0);
}

.v-back-top:hover {
  background: var(--v-coral-dark);
  transform: translateY(-3px);
}

/* --- Responsive --- */
@media (max-width: 1200px) {
  .v-comic-grid { grid-template-columns: repeat(5, 1fr); }
  .v-banner__layout { grid-template-columns: 1fr 260px; }
  .v-recent-row { grid-template-columns: 1fr 280px; }
  .v-footer__top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 992px) {
  .v-comic-grid { grid-template-columns: repeat(4, 1fr); }
  .v-comic-grid--featured { grid-template-columns: repeat(3, 1fr); }
  .v-comic-grid--featured .v-card--comic:first-child { grid-row: auto; }
  .v-comic-grid--featured .v-card--comic:first-child .v-card__cover { padding-top: 0; aspect-ratio: 3 / 4; }
  .v-rank-row { grid-template-columns: 1fr; }
  .v-recent-row { grid-template-columns: 1fr; }
  .v-banner__layout { grid-template-columns: 1fr; }
  .v-banner__side { display: none; }
  .v-footer__top { grid-template-columns: 1fr; gap: var(--v-space-lg); }
}

@media (max-width: 768px) {
  .v-comic-grid { grid-template-columns: repeat(3, 1fr); }
  .v-header__nav { display: none; }
  .v-header__search { width: 180px; }
  .v-banner__main { height: 240px; }
}
