/* ===== 作品设置界面样式 ===== */

/* 主容器 */
#book-settings-content {
    background: #fff;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}



/* 头部区域 */
.book-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 30px 0;
    position: relative;
    background: #fff;
}

/* 头部底边框容器 */
.book-settings-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: #e8e8e8;
    z-index: 1;
}

.book-settings-header .back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    font-size: 16px;
    color: #333;
    cursor: pointer;
    font-weight: 500;
    padding-top: 8px;
}

.book-settings-header .back-btn:hover {
    color: #007bff;
}

.header-tabs {
    display: flex;
    gap: 30px;
    padding-bottom: 20px;
    margin-bottom: 1px;
}

.header-tabs .tab {
    padding: 8px 0;
    color: #666;
    cursor: pointer;
    position: relative;
    font-size: 16px;
}

.header-tabs .tab.active {
    color: #333;
    font-weight: 500;
}

.header-tabs .tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: #007bff;
    z-index: 2;
}

.header-actions {
    display: flex;
    gap: 12px;
    padding-top: 8px;
}

.save-text, .cancel-text {
    color: #999;
    cursor: pointer;
    font-size: 14px;
    font-weight: normal;
}

.save-text:hover, .cancel-text:hover {
    color: #666;
}

.cancel-text {
    margin-right: 15px;
}

/* 值和操作的容器 */
.value-with-action {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 操作链接样式 */
.action-link {
    color: #007bff;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}

.action-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* 基础信息区域 */
.basic-info-section {
    padding: 30px;
    border-bottom: 1px solid #f0f0f0;
}

.basic-info-section h3,
.other-info-section h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
}

.basic-info-section h3::before,
.other-info-section h3::before {
    content: '';
    width: 4px;
    height: 18px;
    background: #ff6b35;
    margin-right: 10px;
}

.info-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 40px;
    align-items: flex-start;
}

/* 封面区域 */
.cover-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cover-section label {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    align-self: flex-start;
}

.cover-display,
.current-cover {
    width: 120px;
    height: 160px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 15px;
    background: #fafafa;
}

.current-cover {
    width: 160px;
    height: 200px;
    border-color: #dee2e6;
    position: relative;
    flex-shrink: 0;
}

.cover-display img,
.current-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-cover-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6c757d;
    background: #f8f9fa;
    font-size: 12px;
}

.no-cover-placeholder i {
    font-size: 24px;
    margin-bottom: 8px;
}

.no-cover-placeholder p {
    margin: 0;
    font-size: 14px;
}

/* 封面操作区域 */
.cover-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    align-items: center;
}

.upload-text-btn {
    color: #007bff;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    padding: 4px 0;
    border-bottom: 1px dashed #007bff;
    transition: all 0.2s ease;
}

.upload-text-btn:hover {
    color: #0056b3;
    border-bottom-color: #0056b3;
}

.cover-requirement {
    font-size: 12px;
    color: #999;
    text-align: center;
    line-height: 1.4;
}

.remove-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #dc3545;
    color: white;
}

.remove-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.cover-tips,
.cover-requirements {
    font-size: 12px;
    color: #999;
    line-height: 1.6;
}

.cover-requirements {
    flex: 1;
    font-size: 14px;
    color: #6c757d;
}

.cover-tips p,
.cover-requirements p {
    margin: 0 0 4px 0;
    font-weight: 500;
    color: #495057;
}

.cover-requirements ul {
    margin: 0;
    padding-left: 20px;
}

.cover-requirements li {
    margin-bottom: 6px;
}

.cover-upload-section {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.cover-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

/* 表单区域 */
.form-section {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-item {
    display: flex;
    flex-direction: column;
}

.form-item label,
label {
    display: block;
    font-size: 14px;
    color: #495057;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-item input,
.form-item textarea,
.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    color: #495057;
    background: #fff;
    transition: all 0.2s ease;
    box-sizing: border-box;
    resize: vertical;
}

.form-item input:focus,
.form-item textarea:focus,
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #ff6d3f;
    box-shadow: 0 0 0 3px rgba(255, 109, 63, 0.1);
}

.form-textarea {
    min-height: 120px;
    font-family: inherit;
}

.form-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=utf-8,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

.display-value {
    font-size: 14px;
    color: #333;
    padding: 12px 0;
    min-height: 20px;
    line-height: 1.5;
}

/* 编辑模式样式 */
.edit-mode .edit-only {
    display: block !important;
}

.edit-mode .display-value {
    display: none !important;
}

.inline-select-hidden {
    appearance: none;
    background: none;
    border: none;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    padding: 0;
    outline: none;
}

.form-item .hint,
.input-hint {
    font-size: 12px;
    color: #6c757d;
    margin-top: 6px;
}

.required {
    color: #dc3545;
    margin-left: 4px;
}

.readonly-label {
    color: #999;
    font-size: 12px;
    font-weight: normal;
}

.readonly-input {
    background-color: #f8f9fa !important;
    color: #6c757d !important;
    cursor: not-allowed;
    border-color: #e9ecef !important;
}

/* 其他信息区域 */
.other-info-section {
    padding: 30px;
}

.info-table {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-row {
    display: grid;
    grid-template-columns: 100px 200px 100px 200px;
    gap: 30px;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f5f5f5;
}

.info-row.single-row {
    grid-template-columns: 100px 1fr;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    position: relative;
}

.info-row .label:contains("ISBN") {
    font-weight: 600;
    color: #495057;
}

.info-row .label:contains("ISBN")::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #ff6d3f, #e55a2b);
    border-radius: 1px;
    opacity: 0.7;
}

.info-row .value {
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
}

.inline-select,
.inline-input {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    background: white;
    min-width: 120px;
}

.inline-select:focus,
.inline-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

/* 表单行和组 */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    flex: 1 1 100%;
}

/* 标签输入区域 */
.tags-input-container {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px;
    background: #fff;
    transition: border-color 0.2s ease;
}

.tags-input-container:focus-within {
    border-color: #ff6d3f;
    box-shadow: 0 0 0 3px rgba(255, 109, 63, 0.1);
}

.tags-input-container .form-input {
    border: none;
    padding: 0;
    margin-bottom: 8px;
}

.tags-input-container .form-input:focus {
    box-shadow: none;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #e9ecef;
    color: #495057;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}

.tag-remove {
    cursor: pointer;
    color: #6c757d;
    font-size: 10px;
    transition: color 0.2s ease;
}

.tag-remove:hover {
    color: #dc3545;
}

/* 复选框组 */
.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 0;
    font-weight: normal;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #ff6d3f;
    border-color: #ff6d3f;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* 底部操作区域 */
.settings-footer {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 30px;
    background: #fff;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.cancel-btn,
.save-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-btn {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.cancel-btn:hover {
    background: #e9ecef;
    color: #212529;
}

.save-btn {
    background: #ff6d3f;
    color: white;
}

.save-btn:hover {
    background: #e55a2b;
    transform: translateY(-1px);
}

.save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* 加载状态 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff6d3f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 表单状态 */
.form-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

.error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 6px;
}

.form-success {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1) !important;
}

.success-message {
    color: #28a745;
    font-size: 12px;
    margin-top: 6px;
}

/* ISBN书号显示样式 */
.isbn-display {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    position: relative;
    transition: all 0.2s ease;
}

.isbn-display:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: #ff6d3f;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 109, 63, 0.15);
}

.isbn-verified {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
}

.isbn-verified i {
    animation: verifiedPulse 2s ease-in-out infinite;
}

@keyframes verifiedPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .cover-section {
        align-items: flex-start;
    }

    .info-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .info-row .label {
        font-weight: 600;
        color: #333;
    }

    .book-settings-header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .header-tabs {
        order: 2;
    }

    .header-actions {
        order: 3;
        align-self: flex-end;
        width: 100%;
        justify-content: flex-end;
    }

    .basic-info-section,
    .other-info-section {
        padding: 20px;
    }

    .form-row {
        flex-direction: column;
        gap: 16px;
    }

    .cover-upload-section {
        flex-direction: column;
        gap: 16px;
    }

    .current-cover {
        width: 120px;
        height: 150px;
        align-self: center;
    }

    .settings-footer {
        padding: 15px 20px;
        flex-direction: column-reverse;
    }

    .cancel-btn,
    .save-btn {
        width: 100%;
        justify-content: center;
    }

    .isbn-display {
        font-size: 13px;
        padding: 3px 6px;
    }
}

@media (max-width: 480px) {
    .book-settings-header .back-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .basic-info-section,
    .other-info-section {
        padding: 15px 10px;
    }

    .form-input,
    .form-textarea,
    .form-select {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* Toast 通知样式 */
.toast {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    max-width: 300px;
    word-wrap: break-word;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    background: #28a745;
}

.toast-error {
    background: #dc3545;
}

/* 完结申请审核状态样式 */
.completion-pending-status {
    color: #ff8c00;
    font-weight: 600;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b3 100%);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    border: 1px solid #ffcc80;
    display: inline-block;
    margin-left: 8px;
    position: relative;
    animation: pendingPulse 2s ease-in-out infinite;
}

.completion-pending-status::before {
    content: '🕒';
    margin-right: 4px;
    font-size: 10px;
}

@keyframes pendingPulse {
    0%, 100% { 
        background: linear-gradient(135deg, #fff3e0 0%, #ffe0b3 100%);
        border-color: #ffcc80;
    }
    50% { 
        background: linear-gradient(135deg, #ffe0b3 0%, #ffcc80 100%);
        border-color: #ff8c00;
        transform: scale(1.02);
    }
} 