/* ========== 优雅粉色主题 - 图书编辑系统 ========== */
:root {
    --primary-pink: #FF85A2;
    --primary-pink-hover: #FF6D8E;
    --secondary-pink: #FFC0D3;
    --accent-pink: #FF4778;
    --background-pink: #FFF5F7;
    --border-pink: #FFD6E0;
    --soft-lavender: #E2D1F9;
    --mint-green: #D0F0C0;
    --dark-text: #5D4E60;
    --medium-text: #8A7B8F;
    --light-text: #BFB5C6;
    --white: #FFFFFF;
    --shadow-sm: 0 4px 6px rgba(255, 133, 162, 0.1);
    --shadow-md: 0 6px 12px rgba(255, 133, 162, 0.15);
    --shadow-lg: 0 15px 25px rgba(255, 133, 162, 0.2);
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --font-primary: 'Poppins', 'Helvetica Neue', sans-serif;
    --font-secondary: 'Playfair Display', serif;
}

/* ========== 全局样式 ========== */
body {
    background-color: var(--background-pink);
    color: var(--dark-text);
    font-family: var(--font-primary);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-secondary);
    color: var(--dark-text);
}

a {
    color: var(--accent-pink);
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-pink-hover);
    text-decoration: none;
}

.btn {
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
    padding: 0.5rem 1.25rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background-color: var(--primary-pink);
    border-color: var(--primary-pink);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-pink-hover);
    border-color: var(--primary-pink-hover);
}

.btn-info {
    background-color: var(--soft-lavender);
    border-color: var(--soft-lavender);
    color: var(--dark-text);
}

.btn-info:hover, .btn-info:focus {
    background-color: #D4BFF0;
    border-color: #D4BFF0;
    color: var(--dark-text);
}

.btn-secondary {
    background-color: var(--white);
    border-color: var(--border-pink);
    color: var(--medium-text);
}

.btn-secondary:hover, .btn-secondary:focus {
    background-color: var(--border-pink);
    border-color: var(--border-pink);
    color: var(--dark-text);
}

.btn i {
    margin-right: 8px;
}

/* ========== 表单容器 ========== */
.book-form-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.book-form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: linear-gradient(to right, var(--primary-pink), var(--accent-pink), var(--soft-lavender));
}

/* ========== 页面标题区域 ========== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--secondary-pink);
}

.page-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary-pink);
    margin: 0;
    position: relative;
    font-family: var(--font-secondary);
}

.flower-icon {
    color: var(--accent-pink);
    margin-right: 8px;
}

.actions {
    display: flex;
    gap: 1rem;
}

/* ========== 表单元素 ========== */
.form-row {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    color: var(--dark-text);
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    display: block;
}

.form-control {
    border: 2px solid var(--border-pink);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem 1rem;
    color: var(--dark-text);
    transition: all var(--transition-fast);
    font-size: 0.95rem;
}

.form-control:focus {
    border-color: var(--primary-pink);
    box-shadow: 0 0 0 0.2rem rgba(255, 133, 162, 0.25);
}

.form-control::placeholder {
    color: var(--light-text);
}

.required {
    color: var(--accent-pink);
}

select.form-control {
height: 42px; / 确保高度一致，内容不截断 */
line-height: 1.5;
padding: 8px 12px;
font-size: 0.95rem;
color: var(--dark-text);
background-color: var(--white);
border: 1px solid var(--border-pink);
border-radius: var(--border-radius-sm);
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%235D4E60' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 0.75rem center;
background-size: 1rem;
transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

select.form-control:focus {
border-color: var(--primary-pink);
outline: none;
box-shadow: 0 0 0 0.2rem rgba(255, 133, 162, 0.2);
}

/* 状态选项 / 分类样式专属修复（可选项） */
#status, #category_id {
padding-top: 8px;
padding-bottom: 8px;
font-family: inherit;
}

/* iOS & Edge 下拉兼容优化 */
select.form-control::-ms-expand {
display: none;
}

/* 浏览器优雅过渡体验 */
select.form-control:hover {
border-color: var(--accent-pink);
}

select.form-control:disabled {
background-color: var(--background-pink);
color: var(--light-text);
cursor: not-allowed;
opacity: 0.7;
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

/* ========== 卡片样式 ========== */
.card {
    border: none;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--transition-base);
    margin-bottom: 1.5rem;
    background-color: var(--white);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background-color: var(--secondary-pink);
    border-bottom: none;
    padding: 1rem 1.5rem;
    font-family: var(--font-secondary);
    font-weight: 600;
    color: var(--dark-text);
    font-size: 1.1rem;
}

.card-body {
    padding: 1.5rem;
    background-color: var(--white);
}

/* ========== 封面图片区域 ========== */
.cover-preview-container {
    padding: 1rem;
    text-align: center;
}

.cover-preview {
    min-height: 300px;
    background-color: var(--background-pink);
    border: 2px dashed var(--secondary-pink);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    position: relative;
    transition: all var(--transition-fast);
}

.cover-preview:hover {
    border-color: var(--primary-pink);
}

.cover-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-sm);
}

.no-cover-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--light-text);
    padding: 2rem;
}

.no-cover-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.upload-container {
    margin-top: 1rem;
}

.btn-outline-primary {
    color: var(--primary-pink);
    border-color: var(--primary-pink);
    background-color: transparent;
    transition: all var(--transition-base);
}

.btn-outline-primary:hover, .btn-outline-primary:focus {
    background-color: var(--primary-pink);
    color: white;
}

/* ========== 提交按钮区域 ========== */
.form-submit-container {
    margin-top: 2rem;
}

.btn-lg {
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
}

/* 输入组样式 */
.input-group-prepend .input-group-text {
    background-color: var(--secondary-pink);
    border-color: var(--border-pink);
    color: var(--dark-text);
    border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
}

/* 聚焦效果 */
.is-focused label {
    color: var(--primary-pink);
}

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

.book-form-container {
    animation: fadeIn 0.5s ease;
}

/* ========== 响应式样式 ========== */
@media (max-width: 992px) {
    .book-form-container {
        padding: 1.5rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .actions {
        margin-top: 1rem;
    }
}

@media (max-width: 768px) {
    .book-form-container {
        padding: 1rem;
    }

    .card-header, .card-body {
        padding: 1rem;
    }

    .cover-preview {
        min-height: 250px;
    }

    .col-md-8, .col-md-4 {
        padding: 0 0.5rem;
    }
}

.is-invalid {
    border-color: #dc3545;
}

.is-valid {
    border-color: #28a745;
}

.invalid-feedback {
    display: none;
    color: #dc3545;
    font-size: 0.875rem;
}

.is-invalid ~ .invalid-feedback {
    display: block;
}
