/* 创建新书页面 - 全新现代化设计 */

.create-book-container {
    max-width: 1000px;
    margin: 30px auto;
    padding: 0 20px;
    min-height: calc(100vh - 200px);
    position: relative;
}

/* 背景装饰 */
.create-book-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* 顶部标题区域 */
.page-hero {
    text-align: center;
    margin-bottom: 35px;
    padding: 30px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    color: white;
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3);
}

.page-hero h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 10px 0;
    letter-spacing: 0.5px;
}

.page-hero p {
    font-size: 14px;
    opacity: 0.95;
    margin: 0;
    font-weight: 300;
}

/* 主内容区域 */
.content-section {
    background: #fff;
    border-radius: 20px;
    padding: 35px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.content-section:hover {
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.12);
}

/* 表单布局 */
.create-book-form {
    padding: 0;
}

.form-row {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 40px;
    align-items: start;
}

/* 左侧封面区域 */
.left-column {
    position: sticky;
    top: 100px;
}

.book-cover-wrapper {
    text-align: center;
}

.cover-preview {
    width: 220px;
    height: 300px;
    margin: 0 auto 20px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    position: relative;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px dashed rgba(102, 126, 234, 0.3);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.cover-preview:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 50px rgba(102, 126, 234, 0.3);
    border-color: #667eea;
}

.cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #667eea;
    transition: all 0.3s ease;
}

.cover-preview:hover .cover-placeholder {
    transform: scale(1.1);
}

.cover-placeholder i {
    font-size: 48px;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cover-placeholder p {
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    color: #667eea;
}

#coverPreview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    transition: all 0.4s ease;
}

.cover-preview:hover #coverPreview {
    transform: scale(1.05);
}

/* 封面加载成功后的样式 */
.cover-preview.has-image {
    border-style: solid;
    border-color: #667eea;
    border-width: 3px;
}

.cover-preview.has-image .cover-placeholder {
    display: none;
}

.upload-btn {
    display: inline-block;
    padding: 12px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 18px rgba(102, 126, 234, 0.4);
    margin-bottom: 15px;
}

.upload-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
}

.upload-btn:active {
    transform: translateY(-1px);
}

.cover-tip {
    font-size: 12px;
    color: #999;
    line-height: 1.8;
    background: #f8f9fa;
    padding: 12px;
    border-radius: 10px;
    border-left: 3px solid #667eea;
}

.cover-tip p {
    margin: 0;
}

/* 右侧表单区域 */
.right-column {
    padding-top: 10px;
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-group label {
    position: absolute;
    left: 20px;
    top: -10px;
    font-weight: 600;
    font-size: 12px;
    color: #667eea;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
    pointer-events: none;
    background: #fff;
    padding: 0 6px;
    z-index: 2;
}

.required {
    color: #f56565;
    margin-left: 2px;
    font-weight: 700;
}

/* 输入框样式 */
.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    background: #ffffff;
    transition: all 0.3s ease;
    font-family: inherit;
    color: #2d3748;
}

.form-group input[type="text"]:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: #cbd5e0;
    background: #f7fafc;
}

.form-group input[type="text"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.form-group input[readonly] {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-color: #e2e8f0;
    color: #718096;
    cursor: not-allowed;
}

.form-group input[readonly]:focus {
    box-shadow: none;
    transform: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #a0aec0;
    font-style: italic;
}

/* 下拉选择框 */
.form-group select.category-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23667eea' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 14px center;
    background-repeat: no-repeat;
    background-size: 18px;
    padding-right: 45px;
    cursor: pointer;
    font-weight: 500;
    max-height: none !important;
    height: auto !important;
    min-height: 48px;
    line-height: 1.4;
}

.form-group select.category-select optgroup {
    font-weight: 700;
    color: #667eea;
    background: #f7fafc;
    padding: 10px;
    font-size: 14px;
}

.form-group select.category-select option {
    padding: 12px;
    font-weight: 500;
    color: #2d3748;
    background: #fff;
}

/* 文本域 */
.form-group textarea {
    min-height: 140px;
    resize: vertical;
    line-height: 1.8;
}

/* 字符计数器 */
.char-count {
    position: absolute;
    right: 16px;
    top: 16px;
    font-size: 11px;
    color: #a0aec0;
    font-weight: 600;
    background: transparent;
    padding: 0;
    border-radius: 0;
    transition: all 0.3s ease;
    z-index: 3;
}

.char-count.warning {
    color: #ed8936;
}

.char-count.danger {
    color: #f56565;
}

/* 提示文字 */
.form-tip {
    font-size: 12px;
    color: #718096;
    margin-top: 6px;
    line-height: 1.5;
    padding-left: 4px;
}

/* 作者笔名验证图标 - 精确居中对齐 */
.form-group .author-verified,
.form-group .account-frozen,
.form-group .account-banned {
    position: absolute;
    right: 14px;
    top: 23px;
    pointer-events: none;
    z-index: 3;
    line-height: 1;
}

.form-group .author-verified i,
.form-group .account-frozen i,
.form-group .account-banned i {
    position: static !important;
    transform: none !important;
    display: block;
    font-size: 16px;
}

/* 协议区域 */
.agreement-section {
    margin-top: 30px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 12px;
    border: 2px dashed #cbd5e0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #2d3748;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #667eea;
}

.agreement-section a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
    transition: all 0.3s ease;
}

.agreement-section a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* 操作按钮 */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 35px;
    padding-top: 30px;
    border-top: 2px solid #f7fafc;
}

.cancel-btn,
.create-btn {
    padding: 13px 40px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    letter-spacing: 0.3px;
}

.cancel-btn {
    background: #edf2f7;
    color: #4a5568;
}

.cancel-btn:hover {
    background: #e2e8f0;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.create-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.create-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.5);
}

.create-btn:active {
    transform: translateY(-1px);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .left-column {
        position: relative;
        top: 0;
    }
    
    .cover-preview {
        width: 200px;
        height: 270px;
    }
}

@media (max-width: 768px) {
    .create-book-container {
        margin: 20px auto;
        padding: 0 15px;
    }
    
    .page-hero {
        padding: 25px 15px;
        margin-bottom: 25px;
        border-radius: 14px;
    }
    
    .page-hero h1 {
        font-size: 24px;
    }
    
    .page-hero p {
        font-size: 13px;
    }
    
    .content-section {
        padding: 25px 18px;
        border-radius: 16px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-actions {
        flex-direction: column-reverse;
        gap: 10px;
    }
    
    .cancel-btn,
    .create-btn {
        width: 100%;
        padding: 12px 28px;
    }
    
    .cover-preview {
        width: 180px;
        height: 245px;
    }
}

@media (max-width: 480px) {
    .content-section {
        padding: 20px 15px;
    }
    
    .page-hero {
        padding: 20px 15px;
    }
    
    .page-hero h1 {
        font-size: 22px;
    }
    
    .page-hero p {
        font-size: 12px;
    }
    
    .form-group input[type="text"],
    .form-group select,
    .form-group textarea {
        padding: 12px 14px;
        font-size: 13px;
    }
    
    .form-group select.category-select {
        min-height: 44px;
        padding-right: 40px;
    }
    
    .form-group .author-verified,
    .form-group .account-frozen,
    .form-group .account-banned {
        right: 12px;
        top: 21px;
    }
    
    .form-group .author-verified i,
    .form-group .account-frozen i,
    .form-group .account-banned i {
        font-size: 15px;
    }
    
    .char-count {
        top: 14px;
        right: 14px;
        font-size: 10px;
    }
    
    .cover-preview {
        width: 160px;
        height: 220px;
    }
}

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

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

.page-hero {
    animation: fadeInUp 0.5s ease-out;
}

.content-section {
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.form-group {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.form-group:nth-child(1) { animation-delay: 0.2s; }
.form-group:nth-child(2) { animation-delay: 0.3s; }
.form-group:nth-child(3) { animation-delay: 0.4s; }
.form-group:nth-child(4) { animation-delay: 0.5s; }

/* 输入框获得焦点时的字符计数器 */
.form-group input:focus + .char-count,
.form-group textarea:focus + .char-count {
    color: #667eea;
}

/* 按钮加载状态 */
.create-btn.loading {
    pointer-events: none;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #667eea 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* 复选框美化 */
.checkbox-label input[type="checkbox"] {
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:hover {
    transform: scale(1.1);
}

.checkbox-label input[type="checkbox"]:checked {
    animation: pulse 0.3s ease-out;
}
