/* ============================================
   VIVID CARTOON THEME - Comic Detail Page
   活力卡通风 - 漫画详情页
   ============================================ */

/* --- Hero Section --- */
.v-detail-hero {
  position: relative;
  padding: var(--v-space-2xl) 0;
  overflow: hidden;
}

.v-detail-hero__bg {
  position: absolute;
  top: -60px;
  left: -20px;
  right: -20px;
  height: 400px;
  background-size: cover;
  background-position: center;
  filter: blur(40px) brightness(0.7);
  z-index: 0;
}

.v-detail-hero__bg::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(to top, var(--v-bg) 0%, transparent 100%);
}

.v-detail-hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  gap: var(--v-space-xl);
}

.v-detail__cover {
  flex-shrink: 0;
  width: 220px;
  border-radius: var(--v-radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  position: relative;
}

.v-detail__cover img {
  width: 100%;
  display: block;
}

.v-detail__info {
  flex: 1;
  min-width: 0;
  padding-top: var(--v-space-md);
}

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

.v-detail__author {
  font-size: 15px;
  color: rgba(255,255,255,0.8);
  margin-bottom: var(--v-space-md);
}

.v-detail__author a {
  color: var(--v-teal-light);
}

.v-detail__stats {
  display: flex;
  gap: var(--v-space-lg);
  margin-bottom: var(--v-space-lg);
}

.v-detail__stat {
  text-align: center;
}

.v-detail__stat-num {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.v-detail__stat-label {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  margin-top: 2px;
}

.v-detail__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--v-space-sm);
  margin-bottom: var(--v-space-lg);
}

.v-detail__desc {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255,255,255,0.7);
  max-height: 80px;
  overflow: hidden;
  position: relative;
}

.v-detail__desc--expanded {
  max-height: none;
}

/* --- Action Buttons --- */
.v-detail__actions {
  display: flex;
  gap: var(--v-space-md);
  margin-top: var(--v-space-lg);
}

.v-detail__action-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--v-space-sm);
  padding: 10px 24px;
  border-radius: var(--v-radius-pill);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--v-duration-normal) var(--v-ease-bounce);
  border: none;
}

.v-detail__action-btn--read {
  background: var(--v-coral);
  color: #fff;
  padding: 12px 32px;
  font-size: 16px;
}

.v-detail__action-btn--read:hover {
  background: var(--v-coral-dark);
  transform: scale(1.05);
  color: #fff;
}

.v-detail__action-btn--collect {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
}

.v-detail__action-btn--collect:hover {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

.v-detail__action-btn--collect.active {
  background: var(--v-teal);
  border-color: var(--v-teal);
}

.v-detail__action-btn--collect .txt2 {
  display: none;
}

.v-detail__action-btn--collect.active .txt1 {
  display: none;
}

.v-detail__action-btn--collect.active .txt2 {
  display: inline;
}

.v-detail__action-btn--ticket {
  background: rgba(255,230,109,0.2);
  color: var(--v-yellow);
  border: 1px solid rgba(255,230,109,0.3);
}

.v-detail__action-btn--gift {
  background: rgba(167,139,250,0.2);
  color: var(--v-purple-light);
  border: 1px solid rgba(167,139,250,0.3);
}

/* --- Content Area --- */
.v-detail-content {
  padding: var(--v-space-xl) 0;
}

.v-detail-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--v-space-xl);
}

/* --- Chapter List --- */
.v-chapters {
  background: var(--v-bg-card);
  border-radius: var(--v-radius-md);
  box-shadow: var(--v-shadow-sm);
  padding: var(--v-space-lg);
}

.v-chapters__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--v-space-md);
}

.v-chapters__title {
  font-size: 18px;
  font-weight: 700;
}

.v-chapters__sort {
  font-size: 13px;
  color: var(--v-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.v-chapters__sort:hover {
  color: var(--v-coral);
}

.v-chapters__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--v-space-sm);
  max-height: 400px;
  overflow: hidden;
  transition: max-height var(--v-duration-slow) var(--v-ease-smooth);
}

.v-chapters__grid--expanded {
  max-height: none;
}

.v-chapters__item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border-radius: var(--v-radius-sm);
  border: 1px solid var(--v-border-light);
  font-size: 13px;
  color: var(--v-text);
  transition: all var(--v-duration-fast) var(--v-ease-smooth);
  position: relative;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

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

.v-chapters__item--vip::after {
  content: 'VIP';
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 9px;
  color: var(--v-vip);
  font-weight: 700;
}

.v-chapters__item--lock::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 12px;
  height: 12px;
  background: var(--v-text-muted);
  border-radius: 2px;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM12 17c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zM9 8V6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM12 17c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zM9 8V6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9z'/%3E%3C/svg%3E");
  mask-size: contain;
  -webkit-mask-size: contain;
}

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

.v-chapters__more {
  text-align: center;
  padding-top: var(--v-space-md);
}

/* --- Gift Section --- */
.v-gifts {
  background: var(--v-bg-card);
  border-radius: var(--v-radius-md);
  box-shadow: var(--v-shadow-sm);
  padding: var(--v-space-lg);
  margin-top: var(--v-space-lg);
}

.v-gifts__grid {
  display: flex;
  gap: var(--v-space-md);
  overflow-x: auto;
  padding-bottom: var(--v-space-sm);
}

.v-gifts__item {
  flex-shrink: 0;
  text-align: center;
  cursor: pointer;
  padding: var(--v-space-sm);
  border-radius: var(--v-radius-sm);
  transition: all var(--v-duration-fast) var(--v-ease-bounce);
}

.v-gifts__item:hover {
  background: rgba(255, 107, 107, 0.06);
  transform: scale(1.05);
}

.v-gifts__item-img {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--v-space-xs);
}

.v-gifts__item-name {
  font-size: 12px;
  color: var(--v-text);
  font-weight: 500;
}

.v-gifts__item-price {
  font-size: 11px;
  color: var(--v-coral);
}

/* --- Comments --- */
.v-comments {
  background: var(--v-bg-card);
  border-radius: var(--v-radius-md);
  box-shadow: var(--v-shadow-sm);
  padding: var(--v-space-lg);
  margin-top: var(--v-space-lg);
}

.v-comments__input {
  display: flex;
  gap: var(--v-space-md);
  margin-bottom: var(--v-space-lg);
}

.v-comments__input-avatar {
  flex-shrink: 0;
}

.v-comments__input-box {
  flex: 1;
}

.v-comments__input-text {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--v-radius-sm);
  border: 2px solid var(--v-border);
  background: var(--v-bg);
  resize: none;
  min-height: 80px;
  font-size: 14px;
  color: var(--v-text);
  transition: border-color var(--v-duration-fast) var(--v-ease-smooth);
}

.v-comments__input-text:focus {
  border-color: var(--v-coral);
}

.v-comments__input-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--v-space-sm);
}

.v-comments__emoji-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--v-text-secondary);
  cursor: pointer;
  transition: color var(--v-duration-fast);
}

.v-comments__emoji-btn:hover {
  color: var(--v-coral);
}

.v-comments__list {
  display: flex;
  flex-direction: column;
}

.v-comments__item {
  display: flex;
  gap: var(--v-space-md);
  padding: var(--v-space-md) 0;
  border-bottom: 1px solid var(--v-border-light);
}

.v-comments__item:last-child {
  border-bottom: none;
}

.v-comments__item-avatar {
  flex-shrink: 0;
}

.v-comments__item-content {
  flex: 1;
  min-width: 0;
}

.v-comments__item-user {
  display: flex;
  align-items: center;
  gap: var(--v-space-sm);
  margin-bottom: 4px;
}

.v-comments__item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--v-text);
}

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

.v-comments__item-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--v-text);
}

.v-comments__item-actions {
  display: flex;
  gap: var(--v-space-md);
  margin-top: var(--v-space-sm);
}

.v-comments__item-action {
  font-size: 12px;
  color: var(--v-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: color var(--v-duration-fast);
}

.v-comments__item-action:hover {
  color: var(--v-coral);
}

/* --- Sidebar --- */
.v-detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--v-space-lg);
}

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

.v-sidebar-card__header {
  padding: var(--v-space-md) var(--v-space-lg);
  border-bottom: 1px solid var(--v-border-light);
  font-size: 16px;
  font-weight: 700;
}

.v-sidebar-card__body {
  padding: var(--v-space-sm) var(--v-space-md);
}

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

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

.v-sidebar-rank-item__num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--v-text-muted);
}

.v-sidebar-rank-item__num--1 { background: var(--v-vip-gradient); }
.v-sidebar-rank-item__num--2 { background: linear-gradient(135deg, #C0C0C0, #A8A8A8); }
.v-sidebar-rank-item__num--3 { background: linear-gradient(135deg, #CD7F32, #B87333); }

.v-sidebar-rank-item__name {
  flex: 1;
  font-size: 13px;
  color: var(--v-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v-sidebar-rank-item__count {
  font-size: 12px;
  color: var(--v-text-muted);
  flex-shrink: 0;
}

/* --- Related Comics --- */
.v-related {
  background: var(--v-bg-card);
  border-radius: var(--v-radius-md);
  box-shadow: var(--v-shadow-sm);
  padding: var(--v-space-lg);
  margin-top: var(--v-space-lg);
}

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

/* --- Responsive --- */
@media (max-width: 992px) {
  .v-detail-hero__inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .v-detail__cover { width: 180px; }
  .v-detail__stats { justify-content: center; }
  .v-detail__tags { justify-content: center; }
  .v-detail__actions { justify-content: center; }
  .v-detail-layout { grid-template-columns: 1fr; }
  .v-chapters__grid { grid-template-columns: repeat(3, 1fr); }
  .v-related__grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .v-chapters__grid { grid-template-columns: repeat(2, 1fr); }
  .v-related__grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- Ticket Dialog --- */
.v-dialog-ticket {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  position: relative;
}

.v-dialog-ticket__close {
  position: absolute;
  top: 16px;
  right: 16px;
  cursor: pointer;
  color: var(--v-text-secondary);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.v-dialog-ticket__close:hover {
  background: #f5f5f5;
}

.v-dialog-ticket__title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--v-text-primary);
}

.v-dialog-ticket__comic {
  font-size: 14px;
  color: var(--v-text-secondary);
  margin: 0 0 12px;
}

.v-dialog-ticket__info {
  display: flex;
  gap: 24px;
  font-size: 13px;
  color: var(--v-text-secondary);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
}

.v-dialog-ticket__info .hl {
  color: var(--v-coral);
  font-weight: 600;
}

.v-dialog-ticket__count {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--v-text-secondary);
}

.v-dialog-ticket__btn {
  width: 36px;
  height: 36px;
  border: 1px solid #e0e0e0;
  background: #fff;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--v-text-primary);
  transition: all 0.2s;
}

.v-dialog-ticket__btn:hover {
  border-color: var(--v-coral);
  color: var(--v-coral);
}

.v-dialog-ticket__input {
  width: 60px;
  height: 36px;
  text-align: center;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--v-text-primary);
  -moz-appearance: textfield;
}

.v-dialog-ticket__input::-webkit-outer-spin-button,
.v-dialog-ticket__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.v-dialog-ticket__empty {
  text-align: center;
  padding: 12px;
  background: #fff5f5;
  border-radius: 8px;
  color: var(--v-coral);
  cursor: pointer;
  font-size: 14px;
  margin-bottom: 16px;
}

.v-dialog-ticket__empty:hover {
  background: #ffe8e8;
}

.v-dialog-ticket__my {
  text-align: center;
  font-size: 13px;
  color: var(--v-text-muted);
  margin: 0;
}

.v-dialog-ticket__my .hl {
  color: var(--v-coral);
  font-weight: 600;
}

/* --- Gift Dialog --- */
.v-dialog-gift {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  position: relative;
}

.v-dialog-gift__close {
  position: absolute;
  top: 16px;
  right: 16px;
  cursor: pointer;
  color: var(--v-text-secondary);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.v-dialog-gift__close:hover {
  background: #f5f5f5;
}

.v-dialog-gift__title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--v-text-primary);
}

.v-dialog-gift__comic {
  font-size: 14px;
  color: var(--v-text-secondary);
  margin: 0 0 12px;
}

.v-dialog-gift__balance {
  font-size: 14px;
  color: var(--v-text-secondary);
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}

.v-dialog-gift__balance .hl {
  color: var(--v-coral);
  font-weight: 600;
}

.v-dialog-gift__selected .hl {
  color: var(--v-purple);
  font-weight: 600;
}

.v-dialog-gift__list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
  max-height: 300px;
  overflow-y: auto;
}

.v-dialog-gift__item {
  text-align: center;
  padding: 12px 8px;
  border: 2px solid #f0f0f0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.v-dialog-gift__item:hover {
  border-color: var(--v-purple-light);
  transform: translateY(-2px);
}

.v-dialog-gift__item.active {
  border-color: var(--v-purple);
  background: #f5f0ff;
}

.v-dialog-gift__item img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  margin-bottom: 6px;
}

.v-dialog-gift__item p {
  font-size: 12px;
  color: var(--v-text-primary);
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.v-dialog-gift__item span {
  font-size: 11px;
  color: var(--v-coral);
  font-weight: 600;
}

.v-dialog-gift__selected {
  font-size: 14px;
  color: var(--v-text-secondary);
  margin: 0 0 20px;
  text-align: center;
  padding: 10px;
  background: #f9f9f9;
  border-radius: 8px;
}

.v-dialog-gift__selected .hl {
  color: var(--v-purple);
  font-weight: 600;
}

/* --- Gift Scroll Marquee --- */
.de-gift__scroll {
  overflow: hidden;
  padding: 8px 0;
}

.de-gift__scroll .scroll-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  font-size: 13px;
  color: var(--v-text-secondary);
  white-space: nowrap;
}

.de-gift__scroll .scroll-item .avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.de-gift__scroll .scroll-item .hl {
  color: var(--v-coral);
}
