/* ============================================
   杂志风格设计系统 - 公开广场、创建小说、小说管理
   风格：大胆、不对称、动态、戏剧性
   ============================================ */

/* ==================== 杂志风配色扩展 ==================== */
:root {
    /* 杂志风专用配色 */
    --magazine-purple: #8b5cf6;
    --magazine-pink: #ec4899;
    --magazine-cyan: #06b6d4;
    --magazine-orange: #f59e0b;
    --magazine-red: #ef4444;
    --magazine-green: #10b981;
    
    /* 杂志风渐变 */
    --magazine-gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --magazine-gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --magazine-gradient-nature: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --magazine-gradient-sunset: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --magazine-gradient-ocean: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* 杂志风阴影 */
    --magazine-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --magazine-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
    --magazine-shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.16);
    --magazine-shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.2);
}

/* ==================== 公开广场 - 杂志风布局 ==================== */

/* 主容器 - 收窄两侧留白 */
#publicSection,
#novelsSection {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 3rem;
}

/* 页面标题 - 大胆排版 */
#publicSection h2,
#novelsSection h2 {
    font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: var(--magazine-gradient-ocean);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

#publicSection h2::after,
#novelsSection h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--magazine-gradient-accent);
    border-radius: 2px;
}

/* 小说卡片网格 - 瀑布流布局 */
#publicNovelsList,
#novelsList {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* 单个小说卡片 - 戏剧性设计 */
.novel-card-magazine {
    position: relative;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--magazine-shadow-md);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
    border: none;
}

.novel-card-magazine::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--magazine-gradient-ocean);
    opacity: 1;
    transition: opacity 0.3s ease;
}

.novel-card-magazine:hover {
    transform: translateY(-8px) rotate(-1deg);
    box-shadow: var(--magazine-shadow-xl);
}

.novel-card-magazine:hover::before {
    opacity: 1;
}

/* 卡片顶部装饰 - 不对称设计 */
.novel-card-magazine .card-decoration {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 80px;
    height: 80px;
    background: var(--magazine-gradient-accent);
    border-radius: 50%;
    opacity: 0.15;
    filter: blur(20px);
    transition: all 0.4s ease;
}

.novel-card-magazine:hover .card-decoration {
    width: 120px;
    height: 120px;
    opacity: 0.25;
}

/* 卡片内容区 */
.novel-card-magazine .card-body {
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* 标题 - 大胆字体 */
.novel-card-magazine .novel-title {
    font-family: 'Inter', 'PingFang SC', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.3;
    color: #1f2937;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 类型标签 - 现代徽章 */
.novel-card-magazine .novel-genre {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 统计信息 - 紧凑布局 */
.novel-card-magazine .novel-stats {
    display: flex;
    gap: 1.5rem;
    padding-top: 1rem;
    border-top: 2px solid #f3f4f6;
    margin-top: 1rem;
}

.novel-card-magazine .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.novel-card-magazine .stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--magazine-gradient-ocean);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.novel-card-magazine .stat-label {
    font-size: 0.75rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* 作者信息 - 底部卡片 */
.novel-card-magazine .author-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 2px solid #f3f4f6;
}

.novel-card-magazine .author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--magazine-gradient-ocean);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.25rem;
}

.novel-card-magazine .author-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #4b5563;
}

.novel-card-magazine .publish-date {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* ==================== 创建小说页面 - 表单艺术化 ==================== */

#generateSection {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 3rem;
}

/* 主标题 */
#generateSection h2 {
    font-family: 'Inter', 'PingFang SC', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: var(--magazine-gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
    animation: titleSlideIn 0.8s ease-out;
}

@keyframes titleSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#generateSection h2 i {
    background: var(--magazine-gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 表单容器 - 双栏不对称布局 */
#generateSection .row {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 3rem;
    align-items: start;
    animation: formFadeIn 1s ease-out 0.2s backwards;
}

@keyframes formFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 左侧表单卡片 */
#generateSection .col-md-8 {
    grid-column: 1;
}

#generateSection .col-md-8 .card {
    background: white;
    border-radius: 32px;
    border: none;
    box-shadow: var(--magazine-shadow-lg);
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

#generateSection .col-md-8 .card:hover {
    box-shadow: var(--magazine-shadow-xl);
}

#generateSection .col-md-8 .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: var(--magazine-gradient-hero);
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background: var(--magazine-gradient-hero);
    }
    50% {
        background: var(--magazine-gradient-accent);
    }
}

/* 装饰性背景元素 */
#generateSection .col-md-8 .card::after {
    content: '';
    position: absolute;
    top: 50px;
    right: -100px;
    width: 300px;
    height: 300px;
    background: var(--magazine-gradient-ocean);
    border-radius: 50%;
    opacity: 0.05;
    filter: blur(80px);
    pointer-events: none;
}

/* 表单头部 */
#generateSection .card-header {
    background: transparent;
    border-bottom: 3px solid #f3f4f6;
    padding: 2.5rem;
    position: relative;
    z-index: 1;
}

#generateSection .card-header h5 {
    font-family: 'Inter', 'PingFang SC', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    position: relative;
    display: inline-block;
}

#generateSection .card-header h5::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 50px;
    height: 4px;
    background: var(--magazine-gradient-accent);
    border-radius: 2px;
}

/* 表单主体 */
#generateSection .card-body {
    padding: 3rem;
    position: relative;
    z-index: 1;
}

/* 表单字段 - 现代化输入框 */
#generateSection .form-label {
    font-family: 'Inter', 'PingFang SC', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#generateSection .form-label::before {
    content: '';
    width: 4px;
    height: 16px;
    background: var(--magazine-gradient-ocean);
    border-radius: 2px;
}

#generateSection .form-control,
#generateSection .form-select {
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    background: #fafafa;
    font-family: 'Inter', 'PingFang SC', sans-serif;
}

#generateSection .form-control:hover,
#generateSection .form-select:hover {
    border-color: #d1d5db;
    background: white;
}

#generateSection .form-control:focus,
#generateSection .form-select:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1), 0 4px 12px rgba(139, 92, 246, 0.15);
    background: white;
    outline: none;
    transform: translateY(-2px);
}

#generateSection .form-control::placeholder {
    color: #9ca3af;
}

/* 文本域特殊样式 */
#generateSection textarea.form-control {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

/* 下拉选择框 */
#generateSection .form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.5em;
    padding-right: 3rem;
}

/* 提交按钮 - 戏剧性设计 */
#generateSection .btn-primary.btn-lg {
    width: 100%;
    padding: 1.5rem 2.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    border: none;
    border-radius: 20px;
    background: var(--magazine-gradient-hero);
    color: white;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    font-family: 'Inter', 'PingFang SC', sans-serif;
    letter-spacing: 0.02em;
}

#generateSection .btn-primary.btn-lg::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

#generateSection .btn-primary.btn-lg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--magazine-gradient-accent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

#generateSection .btn-primary.btn-lg:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(102, 126, 234, 0.5);
}

#generateSection .btn-primary.btn-lg:hover::before {
    left: 100%;
}

#generateSection .btn-primary.btn-lg:hover::after {
    opacity: 0.3;
}

#generateSection .btn-primary.btn-lg:active {
    transform: translateY(-2px);
}

#generateSection .btn-primary.btn-lg i {
    margin-right: 0.75rem;
    position: relative;
    z-index: 1;
}

#generateSection .btn-primary.btn-lg span {
    position: relative;
    z-index: 1;
}

/* 右侧进度卡片 */
#generateSection .col-md-4 {
    grid-column: 2;
    position: sticky;
    top: 100px;
}

#generateSection .col-md-4 .card {
    background: white;
    border-radius: 28px;
    border: none;
    box-shadow: var(--magazine-shadow-md);
    overflow: hidden;
    transition: all 0.3s ease;
}

#generateSection .col-md-4 .card:hover {
    box-shadow: var(--magazine-shadow-lg);
    transform: translateY(-4px);
}

#generateSection .col-md-4 .card-header {
    background: var(--magazine-gradient-ocean);
    color: white;
    border: none;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

#generateSection .col-md-4 .card-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
    animation: rotate 15s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

#generateSection .col-md-4 .card-header h5 {
    font-weight: 700;
    margin: 0;
    font-size: 1.25rem;
    position: relative;
    z-index: 1;
}

#generateSection .col-md-4 .card-body {
    padding: 2rem;
}

/* ==================== 小说管理页面 - 卡片网格布局 ==================== */

/* 管理页面特殊样式 */
#novelsSection .btn-primary {
    background: var(--magazine-gradient-hero);
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

#novelsSection .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

/* 小说管理卡片 - 增强版 */
#novelsList .card {
    border: none;
    border-radius: 20px;
    box-shadow: var(--magazine-shadow-md);
    transition: all 0.3s ease;
    overflow: hidden;
}

#novelsList .card:hover {
    transform: translateY(-4px);
    box-shadow: var(--magazine-shadow-lg);
}

/* ==================== 响应式设计 ==================== */

/* 平板设备 */
@media (max-width: 1024px) {
    #publicSection,
    #novelsSection,
    #generateSection {
        padding: 1.5rem 2rem;
    }
    
    #publicNovelsList,
    #novelsList {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    #generateSection .row {
        grid-template-columns: 1fr;
    }
    
    #generateSection .col-md-4 {
        position: static;
    }
}

/* 手机设备 */
@media (max-width: 768px) {
    #publicSection,
    #novelsSection,
    #generateSection {
        padding: 1rem;
    }
    
    #publicSection h2,
    #novelsSection h2,
    #generateSection h2 {
        font-size: 2rem;
    }
    
    #publicNovelsList,
    #novelsList {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .novel-card-magazine .novel-title {
        font-size: 1.5rem;
    }
    
    #generateSection .card-body {
        padding: 1.5rem;
    }
}

/* ==================== 动画效果 ==================== */

/* 卡片入场动画 */
@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.novel-card-magazine {
    animation: cardFadeIn 0.6s ease-out forwards;
}

/* 交错动画延迟 */
.novel-card-magazine:nth-child(1) { animation-delay: 0.1s; }
.novel-card-magazine:nth-child(2) { animation-delay: 0.2s; }
.novel-card-magazine:nth-child(3) { animation-delay: 0.3s; }
.novel-card-magazine:nth-child(4) { animation-delay: 0.4s; }
.novel-card-magazine:nth-child(5) { animation-delay: 0.5s; }
.novel-card-magazine:nth-child(6) { animation-delay: 0.6s; }

/* 悬停光晕效果 */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(139, 92, 246, 0.2);
    }
    50% {
        box-shadow: 0 8px 32px rgba(139, 92, 246, 0.4);
    }
}

.novel-card-magazine:hover {
    animation: glowPulse 2s ease-in-out infinite;
}

/* ==================== 加载状态优化 ==================== */

#publicNovelsList .text-center,
#novelsList .text-center {
    grid-column: 1 / -1;
    padding: 4rem 2rem;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.25rem;
    border-color: rgba(139, 92, 246, 0.2);
    border-right-color: #8b5cf6;
}

/* ==================== 空状态优化 ==================== */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #9ca3af;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state p {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}
