/* 包子漫画 - 全局样式与设计系统 */
:root {
  --primary: #8b5cf6;
  --primary-light: #a78bfa;
  --primary-dark: #6d28d9;
  --bg-deep: #0a0a18;
  --bg-main: #14142a;
  --bg-card: #1a1a35;
  --bg-elevated: #161630;
  --border: #2d2d55;
  --text-main: #e0e0f0;
  --text-bright: #f0f0ff;
  --text-muted: #8888aa;
  --text-dim: #b0b0d0;
  --gradient-primary: linear-gradient(145deg, #7c3aed, #6d28d9);
  --gradient-bg: linear-gradient(145deg, #0a0a18 0%, #14142a 100%);
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 8px 30px rgba(139, 92, 246, 0.15);
  --transition-fast: all 0.15s ease;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --glass-bg: rgba(26, 26, 53, 0.7);
  --glass-border: rgba(139, 92, 246, 0.2);
}

/* 基础样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  background: var(--gradient-bg);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 链接与文本 */
a {
  color: var(--primary-light);
  text-decoration: none;
  transition: var(--transition-fast);
  position: relative;
}

a:hover {
  color: #c4b5fd;
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-bright);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 2.2rem);
  background: linear-gradient(135deg, var(--text-bright), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  border-left: 5px solid var(--primary);
  padding-left: 15px;
  margin: 2.5rem 0 1.5rem;
  position: relative;
  animation: fadeInUp 0.6s ease both;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 15px;
  width: 60px;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

h3 {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-dim);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 容器 */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* 头部 */
header {
  background: rgba(13, 13, 32, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: var(--transition-smooth);
}

.header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.logo a {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 1px;
  background: linear-gradient(135deg, var(--text-bright), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: var(--transition-smooth);
}

.logo a:hover {
  text-decoration: none;
  transform: scale(1.02);
  filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.3));
}

nav ul {
  display: flex;
  gap: clamp(12px, 2vw, 22px);
  list-style: none;
  flex-wrap: wrap;
}

nav ul li a {
  color: var(--text-dim);
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
  transition: var(--transition-smooth);
  position: relative;
}

nav ul li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: width 0.3s ease;
  border-radius: 2px;
}

nav ul li a:hover {
  color: var(--primary-light);
  text-decoration: none;
  background: rgba(139, 92, 246, 0.1);
}

nav ul li a:hover::after {
  width: 80%;
}

nav ul li a.active {
  color: var(--primary);
  background: rgba(139, 92, 246, 0.15);
}

/* 主内容 */
main {
  padding: 25px 0;
  min-height: 70vh;
}

/* 卡片网格 */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 22px;
  margin-bottom: 2rem;
}

.card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition-smooth);
  position: relative;
  animation: fadeInUp 0.6s ease both;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.3s; }
.card:nth-child(7) { animation-delay: 0.35s; }
.card:nth-child(8) { animation-delay: 0.4s; }
.card:nth-child(9) { animation-delay: 0.45s; }
.card:nth-child(10) { animation-delay: 0.5s; }
.card:nth-child(11) { animation-delay: 0.55s; }
.card:nth-child(12) { animation-delay: 0.6s; }
.card:nth-child(13) { animation-delay: 0.65s; }
.card:nth-child(14) { animation-delay: 0.7s; }
.card:nth-child(15) { animation-delay: 0.75s; }
.card:nth-child(16) { animation-delay: 0.8s; }

.card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  transition: left 0.5s ease;
}

.card:hover::before {
  left: 100%;
}

.card img {
  width: 100%;
  height: auto;
  display: block;
  background: #10102a;
  transition: var(--transition-smooth);
}

.card:hover img {
  transform: scale(1.05);
}

.card-body {
  padding: 15px;
  background: linear-gradient(to top, var(--bg-card), transparent);
}

.card-title {
  color: var(--text-bright);
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  margin-bottom: 5px;
  font-weight: 600;
}

.card-text {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.badge {
  display: inline-block;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(109, 40, 217, 0.2));
  color: var(--primary-light);
  padding: 4px 12px;
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid rgba(139, 92, 246, 0.3);
  backdrop-filter: blur(5px);
}

/* 侧边栏布局 */
.aside-layout {
  display: flex;
  gap: 30px;
  margin-top: 40px;
  align-items: flex-start;
}

article {
  flex: 3;
  min-width: 0;
}

aside {
  flex: 1.2;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  height: fit-content;
  position: sticky;
  top: 90px;
  animation: fadeInRight 0.8s ease both;
}

.aside-item {
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 15px;
}

.aside-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.aside-item h3 {
  color: var(--text-bright);
  font-size: 1.2rem;
  margin-bottom: 12px;
  position: relative;
  padding-left: 12px;
}

.aside-item h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 18px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

.aside-item p, .aside-item li {
  color: var(--text-dim);
  font-size: 0.95rem;
}

.aside-item ul {
  list-style: none;
}

.aside-item li {
  padding: 6px 0;
  transition: var(--transition-fast);
}

.aside-item li:hover {
  color: var(--primary-light);
  padding-left: 5px;
}

.aside-item li::before {
  content: "•";
  color: var(--primary);
  margin-right: 8px;
  font-weight: bold;
}

/* 评论 */
.comment-box {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 12px;
  transition: var(--transition-smooth);
  animation: fadeInUp 0.5s ease both;
}

.comment-box:hover {
  border-color: var(--primary);
  transform: translateX(5px);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.1);
}

.comment-user {
  color: var(--primary-light);
  font-weight: 600;
  font-size: 0.95rem;
}

.comment-time {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-left: 15px;
}

.comment-text {
  color: var(--text-main);
  margin-top: 6px;
  font-size: 0.95rem;
}

/* 按钮组 */
.btn-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 15px;
}

.btn-group a {
  display: inline-block;
  background: var(--gradient-primary);
  color: #ffffff;
  padding: 12px 30px;
  border-radius: 50px;
  margin: 5px 10px 0 0;
  font-weight: 600;
  border: none;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px rgba(109, 40, 217, 0.3);
}

.btn-group a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn-group a:hover {
  background: linear-gradient(145deg, #8b5cf6, #7c3aed);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(139, 92, 246, 0.4);
}

.btn-group a:hover::before {
  left: 100%;
}

/* 页脚 */
.footer {
  background: rgba(10, 10, 24, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 35px 0;
  margin-top: 50px;
  border-top: 1px solid var(--border);
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.footer a {
  color: var(--primary-light);
  transition: var(--transition-fast);
}

.footer a:hover {
  color: #c4b5fd;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  margin-bottom: 20px;
}

.footer-links a {
  padding: 4px 8px;
  border-radius: 6px;
  transition: var(--transition-smooth);
}

.footer-links a:hover {
  background: rgba(139, 92, 246, 0.1);
  transform: translateY(-2px);
}

.footer-copy {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-copy a {
  color: var(--primary-light);
  text-decoration: none;
}

.footer-copy a:hover {
  color: #c4b5fd;
  text-decoration: underline;
}

/* 详情文章 */
.detail-article {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: clamp(20px, 4vw, 30px);
  border-radius: var(--radius-lg);
  margin-bottom: 40px;
  border: 1px solid var(--glass-border);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.8s ease both;
}

.detail-article::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
}

.detail-article h3 {
  color: var(--primary-light);
  margin-top: 1.5rem;
  font-size: 1.2rem;
  position: relative;
  padding-left: 15px;
}

.detail-article h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--primary);
}

.detail-article p {
  color: var(--text-dim);
  line-height: 1.8;
  margin-bottom: 1rem;
}

/* 角色卡片 */
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  margin: 25px 0;
}

.char-card {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
  transition: var(--transition-smooth);
  animation: fadeInUp 0.6s ease both;
}

.char-card:nth-child(1) { animation-delay: 0.1s; }
.char-card:nth-child(2) { animation-delay: 0.2s; }
.char-card:nth-child(3) { animation-delay: 0.3s; }
.char-card:nth-child(4) { animation-delay: 0.4s; }
.char-card:nth-child(5) { animation-delay: 0.5s; }

.char-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
}

.char-card img {
  border-radius: 50%;
  margin-bottom: 10px;
  transition: var(--transition-smooth);
  border: 3px solid transparent;
  background: linear-gradient(45deg, var(--bg-card), var(--bg-elevated));
}

.char-card:hover img {
  border-color: var(--primary);
  transform: scale(1.1);
}

.char-name {
  color: var(--primary-light);
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.char-role {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.char-card p {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 0;
}

/* 平台介绍和APP下载区 */
section[style*="background:#14142e"],
div[style*="background:#1a1a35"] {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 4vw, 30px) !important;
}

/* 滚动动画 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-radius: 5px;
  border: 2px solid var(--bg-deep);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

/* 选中文本样式 */
::selection {
  background: var(--primary);
  color: #ffffff;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .container {
    padding: 0 15px;
  }
  
  .grid-cards {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 18px;
  }
}

@media (max-width: 992px) {
  .aside-layout {
    flex-direction: column;
  }
  
  aside {
    position: static;
    width: 100%;
  }
  
  .grid-cards {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
  }
}

@media (max-width: 768px) {
  .header-flex {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  nav ul {
    justify-content: center;
    gap: 10px;
  }
  
  nav ul li a {
    padding: 6px 10px;
    font-size: 0.9rem;
  }
  
  h1 {
    font-size: 1.8rem;
  }
  
  h2 {
    font-size: 1.4rem;
    margin: 2rem 0 1rem;
  }
  
  .grid-cards {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }
  
  .card-body {
    padding: 10px;
  }
  
  .card-title {
    font-size: 1rem;
  }
  
  .card-text {
    font-size: 0.8rem;
  }
  
  .btn-group {
    flex-direction: column;
    align-items: center;
  }
  
  .btn-group a {
    width: 100%;
    margin: 5px 0;
    text-align: center;
  }
  
  .char-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }
  
  .char-card {
    padding: 12px;
  }
  
  .char-name {
    font-size: 1rem;
  }
  
  .footer-links {
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 10px;
  }
  
  .grid-cards {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }
  
  nav ul {
    gap: 5px;
  }
  
  nav ul li a {
    padding: 5px 8px;
    font-size: 0.8rem;
  }
  
  .comment-box {
    padding: 10px 12px;
  }
  
  .comment-time {
    display: block;
    margin-left: 0;
    margin-top: 4px;
  }
  
  .detail-article {
    padding: 15px;
  }
  
  .char-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

/* 暗色模式增强 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-deep: #060612;
    --bg-main: #0e0e20;
    --bg-card: #161630;
    --bg-elevated: #1a1a35;
    --border: #252545;
  }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 高对比度调整 */
@media (prefers-contrast: high) {
  :root {
    --text-dim: #c0c0d0;
    --text-muted: #a0a0b0;
    --border: #404070;
  }
}

/* 打印样式 */
@media print {
  header, footer, .btn-group, aside {
    display: none !important;
  }
  
  body {
    background: #ffffff;
    color: #000000;
  }
  
  .container {
    max-width: 100%;
  }
  
  .card, .detail-article, .comment-box {
    break-inside: avoid;
    border: 1px solid #ccc;
  }
}

/* 工具类 */
.text-gradient {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass-effect {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
}

.hover-lift {
  transition: var(--transition-smooth);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* 加载动画 */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 悬浮提示 */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  color: var(--text-bright);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-fast);
  border: 1px solid var(--border);
}

.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
}