/* 51漫画页面样式 - 基于Tailwind CSS类名 */

/* CSS变量定义 */
:root {
    --primary: #e63946;
    --secondary: #3a86ff;
    --dark: #212529;
}

/* 基础重置 */
*, ::before, ::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.5;
    color: var(--dark);
    background: #f9fafb;
}

/* 容器 */
.container {
    width: 100%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
}

/* 布局 */
.flex { display: flex; }
.grid { display: grid; }
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }

/* 定位 */
.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }
.fixed { position: fixed; }

/* 间距 */
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.pt-16 { padding-top: 4rem; }
.pb-8 { padding-bottom: 2rem; }
.pl-10 { padding-left: 2.5rem; }
.pr-4 { padding-right: 1rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.mb-16 { margin-bottom: 4rem; }
.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-10 { margin-left: 2.5rem; }
.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }
.mr-4 { margin-right: 1rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-1 { margin-top: 0.25rem; }

/* 尺寸 */
.w-full { width: 100%; }
.w-3 { width: 0.75rem; }
.w-6 { width: 1.5rem; }
.w-12 { width: 3rem; }
.w-16 { width: 4rem; }
.w-24 { width: 6rem; }
.w-64 { width: 16rem; }
.h-3 { height: 0.75rem; }
.h-6 { height: 1.5rem; }
.h-16 { height: 4rem; }
.h-24 { height: 6rem; }
.h-48 { height: 12rem; }
.h-\[400px\] { height: 400px; }
.min-w-full { min-width: 100%; }
.max-w-2xl { max-width: 42rem; }
.aspect-\[3\/4\] { aspect-ratio: 3/4; }
.flex-1 { flex: 1 1 0%; }
.min-w-0 { min-width: 0px; }

/* Flexbox */
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.25rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-x-8 > * + * { margin-left: 2rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }

/* Grid */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* 颜色 */
.bg-white { background-color: #fff; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-primary { background-color: var(--primary); }
.bg-secondary { background-color: var(--secondary); }
.bg-dark { background-color: var(--dark); }
.bg-black\/30 { background-color: rgba(0, 0, 0, 0.3); }
.bg-primary\/10 { background-color: rgba(230, 57, 70, 0.1); }
.bg-secondary\/10 { background-color: rgba(58, 134, 255, 0.1); }

.text-white { color: #fff; }
.text-dark { color: var(--dark); }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-white\/90 { color: rgba(255, 255, 255, 0.9); }
.text-purple-500 { color: #a855f7; }

/* 字体 */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.text-center { text-align: center; }

/* 边框 */
.rounded { border-radius: 0.25rem; }
.rounded-full { border-radius: 9999px; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.border { border-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-t { border-top-width: 1px; }
.border-gray-100 { border-color: #f3f4f6; }
.border-gray-300 { border-color: #d1d5db; }
.border-gray-800 { border-color: #1f2937; }

/* 阴影 */
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1); }

/* 定位工具 */
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }
.top-1\/2 { top: 50%; }
.left-1\/2 { left: 50%; }
.top-2 { top: 0.5rem; }
.left-2 { left: 0.5rem; }
.left-3 { left: 0.75rem; }
.left-4 { left: 1rem; }
.right-4 { right: 1rem; }
.bottom-4 { bottom: 1rem; }
.z-50 { z-index: 50; }

/* 变换 */
.transform { transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); }
.-translate-x-1\/2 { --tw-translate-x: -50%; transform: translate(-50%, var(--tw-translate-y)); }
.-translate-y-1\/2 { --tw-translate-y: -50%; transform: translate(var(--tw-translate-x), -50%); }

/* 其他 */
.overflow-hidden { overflow: hidden; }
.object-cover { object-fit: cover; }
.opacity-50 { opacity: 0.5; }
.opacity-100 { opacity: 1; }
.line-clamp-1 { 
    overflow: hidden; 
    display: -webkit-box; 
    -webkit-box-orient: vertical; 
    -webkit-line-clamp: 1; 
}
.line-clamp-2 { 
    overflow: hidden; 
    display: -webkit-box; 
    -webkit-box-orient: vertical; 
    -webkit-line-clamp: 2; 
}

/* 渐变 */
.bg-gradient-to-t { background-image: linear-gradient(to top, var(--tw-gradient-stops)); }
.bg-gradient-to-r { background-image: linear-gradient(to right, var(--tw-gradient-stops)); }
.from-black\/70 { --tw-gradient-from: rgba(0, 0, 0, 0.7); --tw-gradient-to: transparent; }
.from-primary { --tw-gradient-from: var(--primary); --tw-gradient-to: transparent; }
.from-secondary { --tw-gradient-from: var(--secondary); --tw-gradient-to: transparent; }
.from-purple-500 { --tw-gradient-from: #a855f7; --tw-gradient-to: transparent; }
.to-transparent { --tw-gradient-to: transparent; }
.to-primary\/80 { --tw-gradient-to: rgba(230, 57, 70, 0.8); }
.to-secondary { --tw-gradient-to: var(--secondary); }
.to-secondary\/80 { --tw-gradient-to: rgba(58, 134, 255, 0.8); }
.to-purple-600 { --tw-gradient-to: #9333ea; }

/* 过渡 */
.transition-all { transition-property: all; transition-duration: 150ms; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
.transition-colors { transition-property: color, background-color, border-color; transition-duration: 150ms; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
.transition-opacity { transition-property: opacity; transition-duration: 150ms; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
.transition-transform { transition-property: transform; transition-duration: 150ms; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
.duration-300 { transition-duration: 300ms; }
.duration-500 { transition-duration: 500ms; }
.ease-in-out { transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }

/* 自定义类 */
.comic-card-hover {
    transition: all 0.3s;
}

.comic-card-hover:hover {
    transform: translateY(-0.25rem);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.gradient-overlay {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.7) 100%);
}

/* Hover效果 */
.hover\:bg-black\/50:hover { background-color: rgba(0, 0, 0, 0.5); }
.hover\:bg-gray-50:hover { background-color: #f9fafb; }
.hover\:bg-gray-100:hover { background-color: #f3f4f6; }
.hover\:bg-primary\/90:hover { background-color: rgba(230, 57, 70, 0.9); }
.hover\:text-primary:hover { color: var(--primary); }
.hover\:text-secondary\/80:hover { color: rgba(58, 134, 255, 0.8); }
.hover\:text-white:hover { color: #fff; }
.hover\:underline:hover { text-decoration: underline; }
.hover\:opacity-100:hover { opacity: 1; }

/* Focus效果 */
.focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px rgba(230, 57, 70, 0.5); }

/* 分割线 */
.divide-y > * + * { border-top-width: 1px; border-top-color: #f3f4f6; }

/* 响应式 */
@media (min-width: 640px) {
    .container { max-width: 640px; }
}

@media (min-width: 768px) {
    .container { max-width: 768px; }
    .md\:mb-0 { margin-bottom: 0; }
    .md\:block { display: block; }
    .md\:flex { display: flex; }
    .md\:hidden { display: none; }
    .md\:h-20 { height: 5rem; }
    .md\:h-auto { height: auto; }
    .md\:w-1\/3 { width: 33.333333%; }
    .md\:w-auto { width: auto; }
    .md\:max-w-xl { max-width: 36rem; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .md\:flex-row { flex-direction: row; }
    .md\:divide-x > * + * { border-left-width: 1px; border-left-color: #f3f4f6; border-top-width: 0; }
    .md\:divide-y-0 > * + * { border-top-width: 0; }
}

@media (min-width: 1024px) {
    .container { max-width: 1024px; }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1280px) {
    .container { max-width: 1280px; }
    .xl\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* 图片优化 */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 按钮样式 */
button {
    cursor: pointer;
    border: none;
    background: none;
}

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

/* 输入框样式 */
input {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

input:focus {
    outline: none;
}
